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.
Manasa and Stones
Manasa and Stones
Sort by
recency
|
947 Discussions
|
Please Login in order to post a comment
Here is my c++ solution, you can watch the explanation here : https://youtu.be/BXNoCVP0XEE Solution 1 :
Solution 2 :
I think there is something wrong with the examples except for the first one. The first parameter represents non-zero stone. However, in the rest example, including the test cases, n represents total number of stones including non-zero. This is the solution to pass all of the tests.
Python3
for Python3 Platform