You are viewing a single comment's thread. Return to all comments →
@pankaj113, You can simplify/reduce your code by moving this line
int ex_chocs = wrapper / m;
inside while loop, like so:
while(wrapper >= m) { int ex_chocs = wrapper / m; wrapper = ex_chocs + wrapper % m; chocs += ex_chocs; } System.out.println(chocs);
Seems like cookies are disabled on this browser, please enable them to open this website
Chocolate Feast
You are viewing a single comment's thread. Return to all comments →
@pankaj113, You can simplify/reduce your code by moving this line
inside while loop, like so: