c++ intuitive postorder solution, beats 100% (both time and memory)
\nclass Solution {\npublic:\n    \n    vector<TreeNode*> res;\n    set<int> dp;\n    \n    void util (TreeNode* &root)\n    {\n        if(root!=NULL)\n        {
```\nclass Solution {\npublic:\n    \n    vector<TreeNode*> res;\n    set<int> dp;\n    \n    void util (TreeNode* &root)\n    {\n        if(root!=NULL)\n        {\n            util(root->left);\n            util(root->right);\n            if(dp.find(root->val)!=dp.end())\n            {\n                if(root->left)  res.push_back(root->left);\n                if(root->right) res.push_back(root->right);\n                root=NULL;\n\t\t\t\tdelete root;\n            }\n        }\n    }\n    \n    vector<TreeNode*> delNodes(TreeNode* root, vector<int>& to_delete) {\n\t\n        for(int i=0;i<to_delete.size();i++)\n            dp.insert(to_delete[i]);\n        util(root);\n        if(root)\n            res.push_back(root);\n        return res;\n    }\n};\n```
['C', 'Binary Tree']