← All problemsSign in

Trees vs Storm

Fani hit the Odisha coast at Puri. Alerted by the warnings, people had evacuated the area. However, two unfortunate binary search trees stood tall when the storm raged and rampaged onto the beach. Consequently, they became so weak that they would fall even in the slightest imbalance, i.e. the tree can stay upright if and only if both subtrees of the tree are of equal height. The trees will f

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