Can You Eat It
You are a person who is always fond of eating candies. Your friend gave you a candy of length $N$, to eat during the break period of your school. You start eating this candy from one of the ends. But as it is not your candy, your friend told you to eat **exactly $K$ unit** length of candy during each bite. You will stop eating if the candy's length becomes $0$. This means that you have eaten the
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