top of page

Hacker Rank Problems & Solutions

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

Updated: Jan 27, 2025


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
Best Chunking Practices

1. Chunk by Semantic Boundaries (NOT fixed size only) Split by sections, headings, paragraphs , or logical units. Avoid cutting a sentence or concept in half. Works best with docs, tech specs, policie

 
 
 
Future State Architecture

USE CASE: LARGE RETAIL BANK – DIGITAL CHANNEL MODERNIZATION 🔹 Business Context A large retail bank wants to “modernize” its digital channels (internet banking + mobile apps). Constraints: Heavy regul

 
 
 

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