We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Algorithms
- Implementation
- Chocolate Feast
- Discussions
Chocolate Feast
Chocolate Feast
Sort by
recency
|
1272 Discussions
|
Please Login in order to post a comment
Here is my Python solution!
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 bars=n/c; int wrappers=n/c; while(wrappers>=m){ int new_bar=wrappers/m; bars=bars+new_bar; wrappers=(wrappers%m)+new_bar; } return bars; } see more
my python solution:
def chocolateFeast(n, c, m):