Search
⌘K

Leetcode 1325. Delete Leaves With a Given Value

Given a binary tree and a target value, repeatedly remove all leaf nodes whose value equals the target; removals may create new leaves that also equal the target, so you must prune until no such leaves remain. This is typically solved with a post-order (bottom-up) traversal to decide whether to delete each node.


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.