6-line Python solution, return (subtree max money if not rob this node, subtree max money)
def rob(self, root):\n        def dfs(node):\n            # return (subtree max money if not rob this node, subtree max money)\n            if not node: return 
    def rob(self, root):\n        def dfs(node):\n            # return (subtree max money if not rob this node, subtree max money)\n            if not node: return 0, 0\n            max_l_ignore, max_l = dfs(node.left)\n            max_r_ignore, max_r = dfs(node.right)\n            return max_l + max_r, max(max_l + max_r, node.val + max_l_ignore + max_r_ignore)\n\n        return dfs(root)[1]
['Depth-First Search', 'Python']