Search
⌘K
Get Premium
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.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.