Search
⌘K

Leetcode 1110. Delete Nodes And Return Forest

Delete the nodes whose values are in to_delete from a binary tree and return the roots of the resulting forest. The core challenge is traversing the tree to detach deleted nodes from their parents and collect any children that become new roots (use a hash set for fast membership checks).


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.