Problem 2458 · Hard

Height of Binary Tree After Subtree Removal Queries

For each node, the height left after removing its subtree is the larger of the height above it and the tallest path through its parent that avoids it.

Open the interactive visualisation