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.
This problem is worded poorly. The objective is stated:
Can you find and print the minimum number of passes required for Karl to make at least n units of candies?
Making the candies implies m*w >= n
Instead, according to the test cases, it appears the real question is to find the minimum number of passes for Karl to HAVE n units of candies in his possession.
Someone correct me if I am wrong, but I do not see how Test Case #1 can "make" 45 units in 16 passes. 17 passes are required to produce >= 45 units. Karl can have 45 units in his possession after 16 passes if none are spent in the previous pass.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Making Candies
You are viewing a single comment's thread. Return to all comments →
This problem is worded poorly. The objective is stated: Can you find and print the minimum number of passes required for Karl to make at least n units of candies?
Making the candies implies m*w >= n Instead, according to the test cases, it appears the real question is to find the minimum number of passes for Karl to HAVE n units of candies in his possession.
Someone correct me if I am wrong, but I do not see how Test Case #1 can "make" 45 units in 16 passes. 17 passes are required to produce >= 45 units. Karl can have 45 units in his possession after 16 passes if none are spent in the previous pass.