top of page

Hacker Rank Problems & Solutions

  • Writer: Anand Nerurkar
    Anand Nerurkar
  • Jan 23
  • 1 min read

Updated: Jan 27

ree
ree
ree
ree

chocofunction

==


static int chocofest(int n, int c, int m){

int choco=n/c;

int newchoco=0;

int wrap=choco;


while(wrap>=m){

newchoco=wrap/m;

choco=choco+newchoco;

wrap=(wrap mod c + newchoco


}

return choco;


}


ree

scenario 1

ree

ree
ree

find digits

==

ree

ree

ree

ree
ree

ree

ree

static string catAndMouse(int x,int y, int z){


int cat1tomousedist=0;

int cat2tomousedist=0;


//x---cat1 y ---cat2 z---mouse


if(x<z){

cat1tomousedist=z-x;

}else{

cat1tomousedist=x-z;

}


if(y<z){

     cat2tomousedist=z-y;

}else{

    cat2tomousedist=y-z;

}

if(cat1tomousedist==cat2tomousedist){

return "mouse C";

}else if (cat1tomousedist<cat2tomousedist){

return "Cat A ";

}else{

return "Cat B";

}

}

}

 
 
 

Recent Posts

See All
why springbatch job??

Spring Batch Job Spring Batch is designed exactly for batch workloads  like Pro*C migrations. ✅ Advantages: Chunk-oriented processing...

 
 
 
Pro*c Job to Spring Batch Job

Example1: 📌 Background Pro*C job  → Written in C with embedded SQL, often used for batch ETL-like jobs in Oracle. Spring Batch job  →...

 
 
 

Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating
  • Facebook
  • Twitter
  • LinkedIn

©2024 by AeeroTech. Proudly created with Wix.com

bottom of page