'Decodes your encoded data to tree.
:type data: str
:rtype: TreeNode'

def deserialize(self, data):

    def deserializeHelper():
        val = next(vals)
        if (val == '#'):
            return None
        else:
            node = TreeNode(int(val))
            node.left = deserializeHelper()
            node.right = deserializeHelper()
            return node
    def isplit(source, sep):
        sepsize = len(sep)
        start = 0
        while True:
            idx = source.find(sep, start)
            if (idx == (-1)):
                (yield source[start:])
                return
            (yield source[start:idx])
            start = (idx + sepsize)
    vals = iter(isplit(data, '    '))
    return deserializeHelper()
