Simple Approach || Faster than others || postorder traversal
\n\n# Code\n\n/**\n * Definition for a binary tree node.\n * struct TreeNode {\n *     int val;\n *     TreeNode *left;\n *     TreeNode *right;\n *     TreeNod
\n\n# Code\n```\n/**\n * Definition for a binary tree node.\n * struct TreeNode {\n *     int val;\n *     TreeNode *left;\n *     TreeNode *right;\n *     TreeNode() : val(0), left(nullptr), right(nullptr) {}\n *     TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}\n *     TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}\n * };\n */\nclass Solution {\npublic:\n    vector<TreeNode*>res;\n    unordered_set<int>st;\n    void deleteNodeUtil(TreeNode* &root){\n        if(root){\n            deleteNodeUtil(root->left);\n            deleteNodeUtil(root->right);\n            if(st.find(root->val)!=st.end()){\n                if(root->left)res.push_back(root->left);\n                if(root->right)res.push_back(root->right);\n                root=NULL;\n                delete root;\n            }\n        }\n        \n\n    }\n    vector<TreeNode*> delNodes(TreeNode* root, vector<int>& to_delete) {\n        for(int i=0;i<to_delete.size();i++){\n            st.insert(to_delete[i]);\n        }\n        deleteNodeUtil(root);\n        if(root)res.push_back(root);\n        return res;\n    }\n};\n\n\n```
['Depth-First Search', 'C++']