Problem 3593 · Medium

Minimum Increments to Equalize Leaf Paths

Process the tree bottom up: each node lifts every child whose path total falls short of the largest one, and each lift is counted once.

Open the interactive visualisation