# Definition for a binary tree node.
# class TreeNode(object):
#     def __init__(self, x):
#         self.val = x
#         self.left = None
#         self.right = None

class Solution(object):
    def do_rob(self, cur):
        if not cur:
            return 0, 0
        else:
            robl, no_robl = self.do_rob(cur.left)
            robr, no_robr = self.do_rob(cur.right)

            rob_cur, no_rob_cur = cur.val + no_robl + no_robr, max(robl, no_robl) + max(robr, no_robr)
            return rob_cur, no_rob_cur

    def rob(self, root):
        """
        :type root: TreeNode
        :rtype: int
        """
        return max(self.do_rob(root))

Add py solution for 337. House Robber III
Add py solution for 337. House Robber III

337. House Robber III: https://leetcode.com/problems/house-robber-iii/

Approach:
    Observe the first item remaining in each step. The value will be added
    1 << step either the remaining count is odd or it's a left-to-right
    step. Hence the n | 0x55555.. is the key.
