C++ Solution || Using Unordered map
\nclass Solution {\npublic:\n    unordered_map<TreeNode*, int>mp;\n    int rob(TreeNode* root) {\n        if(root == NULL) return 0;\n        if(mp.find(root) !
```\nclass Solution {\npublic:\n    unordered_map<TreeNode*, int>mp;\n    int rob(TreeNode* root) {\n        if(root == NULL) return 0;\n        if(mp.find(root) != mp.end()) return mp[root];\n        \n        int total = 0;\n        if(root->left) total += (rob(root->left->left) + rob(root->left->right));\n        if(root->right) total += (rob(root->right->left) + rob(root->right->right));\n        return mp[root] = max((root->val+total), (rob(root->left)+rob(root->right)));\n    }\n};\n```
['C', 'C++']