Solution: Delete Nodes And Return Forest
Solution: Delete Nodes And Return Forest gives you a binary tree and a list of values to delete. Return the roots of every disjoint tree left in the resulting forest, in any order.
We'll cover the following...
We'll cover the following...
Statement
Given the root of a binary tree where each node has a unique value, your task is to delete all nodes with values specified in the delete_nodes list. After performing the deletions, the tree will split into a forest—a collection of disjoint trees. Return the roots of the remaining trees in the forest in any order.
Constraints:
nodes...