Python beats 99.37%, easy to understand
Bottom up recursion\nIdea: When we delete a node it\'s children form two trees. \n\n\nAlgorithm: If current node is to be deleted then add it\'s children after 
# Bottom up recursion\n**Idea:** When we delete a node it\'s children form two trees. \n\n\n**Algorithm:** If current node is to be deleted then add it\'s children after checking if they are not null.\nSpcially handle if root is to be deleted.\n\n\n\n```python\nclass Solution:\n    def delNodes(self, root: TreeNode, to_delete: List[int]) -> List[TreeNode]:\n        ans = []\n        to_delete = set(to_delete)\n        \n        def helper(node):\n            if not node:\n                return None\n            node.left = helper(node.left)\n            node.right = helper(node.right)\n\t\t\t\n\t\t\t# add children of a node that is to be deleted\n            if node.val in to_delete:\n                if node.left: \n                    ans.append(node.left)\n                if node.right:\n                    ans.append(node.right)\n                return None\n            return node\n                \n        helper(root)\n\t\t# if root is not to be deleted then add it\n        if root.val not in to_delete:\n            ans.append(root)\n        return ans\n```
['Recursion', 'Python']