← All problemsSign in

Take Me To Him

Lord Voldemort decided to kill baby Harry Potter and hence wants to go to his hometown. He asked Bellatrix to find the location his house. Bellatrix got the location in a encoded form. Harry's hometown can be represented as a tree with $N$ nodes(numbered from $1$ to $N$). Each node has a value a[i] (0 Constraints: 1 Input: Firt line contains an integer $N$ denoting the number of nodes. Next $N-

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