Easy to understand Java solution (DFS)
\n\npublic List<TreeNode> delNodes(TreeNode root, int[] to_delete) {\n        // list to store all the root nodes after deletion\n        List<TreeNode> result 
```\n\npublic List<TreeNode> delNodes(TreeNode root, int[] to_delete) {\n        // list to store all the root nodes after deletion\n        List<TreeNode> result = new ArrayList<>();\n\t\t//All the nodes to be deleted in a HashSet for fast lookup\n        Set<Integer> toDelete = new HashSet<>();\n        \n        for(int i=0;i<to_delete.length;i++){\n            toDelete.add(to_delete[i]);\n        }\n        \n        dfs(root,result,toDelete);\n\t\t//ensuring that we\'re not missing the case where root itself required to be deleted. \n        if(!toDelete.contains(root.val)){\n            result.add(root);\n        }\n        return result;\n        \n    }\n    \n    \n    public TreeNode dfs(TreeNode root, List<TreeNode> result, Set<Integer> toDelete){\n        \n        if(root==null){\n            return null;\n        }\n        \n        root.left = dfs(root.left, result, toDelete);\n        root.right = dfs(root.right, result, toDelete); \n        \n\t\t//in case the element needs to be removed, we need to store both the left, right nodes into result. \n        if(toDelete.contains(root.val)){\n            if(root.left != null){\n                result.add(root.left);\n            }\n            if(root.right != null){\n                result.add(root.right);\n            }\n\t\t\t//it is also important to note that we need to point the parent left/right child(s) to null ,  to separate from left, right nodes. So, we need to return null here. \n            return null;\n        }\n        \n        return root;\n              \n        \n    }\n\n```
['Java']