← All problemsSign in

Candy Time

You have $n$ gift packets of candies and you want to give all of them to children. Of course, you don't want to hurt anyone, so you want to minimize the difference between candies that any two children will get. In one move you can take a gift packet , and take a single candy from it and put it in any other gift packet. You want to find the minimum difference of candies that any two children wil

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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start