Python solution beats 100 % inspired by the top post
\nclass Solution:\n    def rob(self, root):\n        def dfs(node):\n            if not node: return 0, 0\n            l, r = dfs(node.left), dfs(node.right)\n 
```\nclass Solution:\n    def rob(self, root):\n        def dfs(node):\n            if not node: return 0, 0\n            l, r = dfs(node.left), dfs(node.right)\n            return max(l) + max(r), node.val + l[0] + r[0]\n        return max(dfs(root))\n```
[]