@@ -0,0 +1,879 @@
+# Definition for a binary tree node.%0A# class TreeNode(object):%0A#     def __init__(self, x):%0A#         self.val = x%0A#         self.left = None%0A#         self.right = None%0A%0Aclass Solution(object):%0A    def hasPathSum(self, root, pathSum):%0A        %22%22%22%0A        :type root:     TreeNode%0A        :type pathSum:  int%0A        :rtype:         bool%0A        %22%22%22%0A        if root == None:%0A            return False%0A        %0A        if root.left == None and root.right == None:%0A            return pathSum - root.val == 0%0A        %0A        leftHasPathSum  = False%0A        rightHasPathSum = False%0A        %0A        if root.left != None:%0A            leftHasPathSum = self.hasPathSum(root.left,  pathSum - root.val) %0A            %0A        if root.right != None:%0A            rightHasPathSum = self.hasPathSum(root.right, pathSum - root.val)%0A            %0A        return leftHasPathSum or rightHasPathSum%0A

Create solution.py