[Python] DFS solution with explanations
Explanations:\nFor each node, the robber can either rob this node and leave out the consecutive left and right nodes, or he/she can not rob this node and try ou
**Explanations**:\nFor each node, the robber can either rob this node and leave out the consecutive left and right nodes, or he/she can not rob this node and try out different combinations to find the max value that he/she can rob. The combinations include rob 1. both left and right nodes, 2. rob only left node and not rob the right one, 3. rob only right node and not rob the left one, 4. rob neither of the left or right nodes. \n`_rob` function will return the two scenario for each node.\nIn the end, return the mac value.\n\n**Complexcity**: Time O(N), N is the number of nodes. Space O(1).\n```\nclass Solution:\n    def rob(self, root: TreeNode) -> int:\n        def _rob(node):\n            if not node: return 0, 0\n            left, left_no = _rob(node.left)\n            right, right_no = _rob(node.right)\n            cur = node.val + left_no + right_no\n            no = max(left + right, left + right_no, left_no + right, left_no + right_no)\n            return cur, no\n        return max(_rob(root))\n```
[]