← All problemsSign in

Candies

To celebrate the success of the latest edition of his famous book, Cormen wants to distribute candies among kids. Some critics argue that this is his way of apologizing to the thousands of students across the globe who struggle with the intricacies in his books on a daily basis; but for the sake of the question, it shall suffice to assume that he is distributing candies only for celebration purpos

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