← All problemsSign in

Toffees

Its Children's day. Your friend is a teacher in a primary school. She wants to give some toffees to the children in her class. All the children sit in a line and each of them has a rating score according to his or her performance in the class. She wants to give at least 1 toffee to each child. If two children sit next to each other, then the one with the higher rating must get more toffees. She wa

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