← All problemsSign in

Happy Students

Suppose students are standing in a queue for the Sunday ice-cream in IISc Mess. They all like ice-cream and each one has some amount of rupees with them. A student gets really upset when there is someone with strictly less money standing in the queue in front of them.The students follow a protocol that anyone can pay 1 rupee (if he/she has it) to the person standing just in front of them and excha

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