NeetCode solution|| Clean code
\n# Code\n\nclass Solution {\npublic:\n\n    pair<int,int> helper(TreeNode* root){\n        if(root == NULL) return {0,0};\n\n        pair<int,int> left1 = help
\n# Code\n```\nclass Solution {\npublic:\n\n    pair<int,int> helper(TreeNode* root){\n        if(root == NULL) return {0,0};\n\n        pair<int,int> left1 = helper(root->left);\n        pair<int,int> right1 = helper(root->right);\n\n        int with = root->val + left1.second + right1.second ;\n        int without = max(left1.first, left1.second) + max(right1.first, right1.second);\n\n        return {with, without};\n    }\n    int rob(TreeNode* root) {\n        pair<int,int> ans = helper(root);\n        return max(ans.first, ans.second);\n    }\n};\n```
['C++']