Search
⌘K

Leetcode 1080. Insufficient Nodes in Root to Leaf Paths

Given a binary tree and a limit, prune (delete) every node for which every root-to-leaf path passing through it has a sum strictly less than the limit, and return the resulting tree. The core challenge is a postorder DFS that determines for each node whether any root-to-leaf path through it meets the limit and removes nodes that don't.


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.