Simple Python Solution
def isValidSerialization(self, preorder):\n        preorder = preorder.split(',')\n        balance = 1\n        for item in preorder:\n            balance -= 1\
    def isValidSerialization(self, preorder):\n        preorder = preorder.split(',')\n        balance = 1\n        for item in preorder:\n            balance -= 1\n            if balance < 0:\n                return False\n            if item != '#':\n                balance += 2\n        return balance == 0\n##Every parent node will introduce 2 children. One child must have a parent. So if a node has 2 children, it should add 2, otherwise do not add. For every node introduced, it should -1 to balance parent number. Initial balance is 1 because root is special case.
[]