← All problemsSign in

Happy Diwali!

Year 3018, Raj is celebrating the festival of Diwali with his family. Diwali is an Indian festival known as the festival of lights. There is a tradition of giving a candy to each member of the family who is lower to you in the family tree hierarchy. The family tree is a tree rooted at $1$ which holds the information about the ancestors and descendants of the family. Member __X is lower to member

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