Some Intuition With Pictures, - May be this could help
Some intution\n\n\n\nQuestion That we have\n What if we select this node? What Options Do we have? \n If we dont select this node then what could be the answer 
Some intution\n\n![image](https://assets.leetcode.com/users/images/f5010d75-8b50-4134-a817-5202a2509e29_1616104945.9881916.png)\n\n**Question That we have**\n* What if we select this node? What Options Do we have? \n* If we dont select this node then what could be the answer at this Point\n* If we select this node then how do we get the answers for child nodes ? \n\n\nLets find answers to these two questions. Lets us ask Child nodes the best possible solutions if we want to include the Immediate child\'s value.\nOr if we skip then what is the best possible answers that we can get. Let\'s ask them.\n\n* Now Assume Child Node responds with his best answers for \n{ if  we his (child\'s) value  , If we dont Include ie we skip }\n\n\n```\npair<int,int> sub(TreeNode *root)\n    {\n        if(!root)\n            return {0,0};\n        \n        pair<int,int> leftChildAnswer = sub(root->left);\n        pair<int,int> rightChildAnswer= sub(root->right);\n        \n        int best_If_ParentValueIncluded    =  root->val + leftChildAnswer.second + rightChildAnswer.second;\n\n        int best_If_ParentValueNotIncluded =  max(rightChildAnswer.first , rightChildAnswer.second)\n                                              + max(leftChildAnswer.first , leftChildAnswer.second);\n        \n        return {best_If_ParentValueIncluded , best_If_ParentValueNotIncluded};\n    }\n    \n    int rob(TreeNode* root) \n    {\n        pair<int,int> ans = sub(root);\n        return max(ans.first , ans.second);\n    }\n```
[]