maximum benefit involves decision of whether to rob current one or not.

```
int rob(TreeNode* root) {
return rob_help(root).first;
}
pair<int, int> rob_help(TreeNode *root) {
pair<int, int> result(0, 0);
if (root != NULL) {
pair<int, int> left = rob_help(root->left);
pair<int, int> right = rob_help(root->right);
result.second = left.first + right.first;
result.first = max(root->val + left.second + right.second, result.second);
}
return result;
}
```