Problem 2673 · Medium

Make Costs of Paths Equal in a Binary Tree

Working upward from the leaves, each node raises its cheaper child subtree to match the costlier one, which keeps every path equal at the lowest cost.

Open the interactive visualisation