Python O(n) code: Optimized for Readability
Implementing the decoupled recursive approach detailed here\n\n\nclass Solution(object):\n    def rob(self, root):\n        """\n        :type root: TreeNode\n 
Implementing the decoupled recursive approach detailed [here](https://discuss.leetcode.com/topic/39834/step-by-step-tackling-of-the-problem)\n\n```\nclass Solution(object):\n    def rob(self, root):\n        """\n        :type root: TreeNode\n        :rtype: int\n        """\n        def superrob(node):\n            # returns tuple of size two (now, later)\n            # now: max money earned if input node is robbed\n            # later: max money earned if input node is not robbed\n            \n            # base case\n            if not node: return (0, 0)\n            \n            # get values\n            left, right = superrob(node.left), superrob(node.right)\n            \n            # rob now\n            now = node.val + left[1] + right[1]\n            \n            # rob later\n            later = max(left) + max(right)\n            \n            return (now, later)\n            \n        return max(superrob(root))\n```
[]