(self, root, sum)
| 21 | |
| 22 | class Solution(object): |
| 23 | def hasPathSum(self, root, sum): |
| 24 | if not root: |
| 25 | return False |
| 26 | if root.val == sum and root.left is None and root.right is None: |
| 27 | return True |
| 28 | return self.hasPathSum(root.left, sum-root.val) or self.hasPathSum(root.right, sum-root.val) |
nothing calls this directly
no outgoing calls
no test coverage detected