top of page

Hacker Rank Problems & Solutions

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

Updated: Jan 27


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;


}



scenario 1



find digits

==







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
SOC2

SOC 2  (System and Organization Controls 2) is a widely recognized compliance framework  that evaluates how an organization manages...

 
 
 
RTO & RPO

✅ 1. What is RTO (Recovery Time Objective)? Definition: RTO is the maximum acceptable downtime  after a failure or disaster.It defines...

 
 
 

Commenti

Valutazione 0 stelle su 5.
Non ci sono ancora valutazioni

Aggiungi una valutazione
  • Facebook
  • Twitter
  • LinkedIn

©2024 by AeeroTech. Proudly created with Wix.com

bottom of page