Short Python solution
class Solution(object):\n        def rob(self, root):\n            def solve(root):\n                if not root:\n                    return 0, 0\n            
    class Solution(object):\n        def rob(self, root):\n            def solve(root):\n                if not root:\n                    return 0, 0\n                left, right = solve(root.left), solve(root.right)\n                return (root.val + left[1] + right[1]), (max(left) + max(right))\n            return max(solve(root))
['Python']