You are viewing a single comment's thread. Return to all comments →
Here is my easy c++ solution , you can watch the explanation here : https://youtu.be/RZti_qPbiAA
int chocolateFeast(int n, int c, int m) { int result = 0, wrappers = 0; while( n >= c){ result ++; wrappers ++; n -= c; if(wrappers == m){ result ++; wrappers = 1; } } return result; }
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 →
Here is my easy c++ solution , you can watch the explanation here : https://youtu.be/RZti_qPbiAA