← All problemsSign in

Party In the ClubHouse

Sudhanshu and Harsh are Best Friends. So they finally decided to meet at Clubhouse Of MNIT(which is situated at the root of the tree). But their Houses are at the nodes of the undirected tree (rooted at 1). Sudhanshu’s house is at node x and Harsh’s House is at node y. Each Sudhanshu and  Harsh has Stamina values. The stamina value of Sudhanshu and Harsh is S and H respectively. But there are

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