Python DFS Recursive Solution
\nclass Solution:\n    cnt = 0\n    def pathSum(self, root: TreeNode, sum: int) -> int:\n        def dfs(root, start, s):\n            if not root:\n           
```\nclass Solution:\n    cnt = 0\n    def pathSum(self, root: TreeNode, sum: int) -> int:\n        def dfs(root, start, s):\n            if not root:\n                return\n            s -= root.val \n            if s==0:\n                self.cnt+=1\n            dfs(root.left,False, s)\n            dfs(root.right,False, s)\n            if start: \n                dfs(root.left,True,sum)\n                dfs(root.right,True,sum)\n        \n        dfs(root, True, sum)\n        return self.cnt\n```
['Depth-First Search', 'Recursion', 'Python', 'Python3']