Search⌘ K
AI Features

Delete Nodes And Return Forest

Delete Nodes And Return Forest removes nodes whose values appear in a given list from a binary tree, then asks you to return the roots of every disjoint tree left behind in any order.

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 ...