TOFFIES IN JAR
CodeChefOpen on judge ↗
There is a JAR full of toffies for sale at a mall counter. JAR has the capacity $N$, that is JAR can contain maximum $N$ toffies when JAR is full. At any point of time. JAR can have $M$ number of Candies where $M<=N$. toffies are served to the customers. JAR never remains empty as when last $k$ toffies are left. JAR is refilled with new candies in such a way that JAR gets full. Write a code t
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start