Python Intuitive O(n) solution
For each node, compute the maximum money whether choosing the node or not.\n```\nclass Solution:\n    def rob(self, root: TreeNode) -> int:\n        \n        d
For each node, compute the maximum money whether choosing the node or not.\n```\nclass Solution:\n    def rob(self, root: TreeNode) -> int:\n        \n        def check(root): \n\t\t# return a tuple (choosing the root, not choosing the root)\n            if not root:\n                return (0,0)\n            left = check(root.left)\n            right = check(root.right)\n            return (root.val + left[1] + right[1], max(left) + max(right))\n        \n        return max(check(root))\n\t\t
[]