Search
⌘K

Leetcode 2673. Make Costs of Paths Equal in a Binary Tree

Given a perfect binary tree with costs on each node and the ability to increment any node's cost by 1, find the minimum number of increments needed so every root-to-leaf path has the same total cost. Solve by a bottom-up traversal (DP) that at each node raises the smaller child path total to the larger, accumulating the increments required.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.