Python DP Soln
\nclass Solution:\n    def dp(self, root, dp):\n        if not root: return 0\n        if root in dp:\n            return dp[root]\n        \n        val = 0\n 
```\nclass Solution:\n    def dp(self, root, dp):\n        if not root: return 0\n        if root in dp:\n            return dp[root]\n        \n        val = 0\n        if root.left:\n            val += self.dp(root.left.left, dp) + self.dp(root.left.right, dp)\n        \n        if root.right:\n            val += self.dp(root.right.left, dp) + self.dp(root.right.right, dp)\n    \n        val = max(val + root.val, self.dp(root.left, dp) + self.dp(root.right, dp))\n        dp[root] = val\n        return val\n    \n    def rob(self, root: TreeNode) -> int:\n        dp = {}\n        return self.dp(root, dp)\n```
['Memoization', 'Python']