C++ || RECURSION || POSTORDER TRAVERSAL || DFS
\nclass Solution {\npublic:\n    void solve(TreeNode* root,unordered_set<int> &v,vector<TreeNode*> &ans,char d = \'x\',TreeNode* p = NULL){\n        if(root == 
```\nclass Solution {\npublic:\n    void solve(TreeNode* root,unordered_set<int> &v,vector<TreeNode*> &ans,char d = \'x\',TreeNode* p = NULL){\n        if(root == NULL)return;\n        solve(root->left,v,ans,\'l\',root);\n        solve(root->right,v,ans,\'r\',root);\n        if(v.count(root->val)){\n            if(root->left){\n                ans.push_back(root->left);\n                root->left = NULL;\n            }\n            if(root->right){\n                ans.push_back(root->right);\n                root->right = NULL;\n            }\n            if(d==\'l\'){\n                p->left = NULL;\n            }else if(d==\'r\'){\n                p->right = NULL;\n            }\n        }\n        if(p==NULL&&v.count(root->val)==0){\n            ans.push_back(root);\n        }\n    }\n    vector<TreeNode*> delNodes(TreeNode* root, vector<int>& v) {\n        unordered_set<int> s;\n        for(auto &i: v)s.insert(i);\n        vector<TreeNode*> ans;\n        solve(root,s,ans);\n            return ans;\n    }\n};\n```
['Depth-First Search', 'Recursion', 'C', 'C++']