← All problemsSign in

Tree for Trijeet

For setting the coding problems for Heritage Utsav, Alfarhan gifted Trijeet a tree. An actual, physical tree. Although it can be represented as a tree in mathematical sense as well. Looking at the tree, Trijeet came up with another problem and now he wants you to solve it. Three types of events can happen - $1$ - remove($x,y$) : Trijeet can cut off any branch from the tree, converting it into a

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