We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9861d3c commit 1f99402Copy full SHA for 1f99402
src/main/python/g0401_0500/s0437_path_sum_iii/Solution.py
@@ -1,6 +1,6 @@
1
# #Medium #Top_100_Liked_Questions #Depth_First_Search #Tree #Binary_Tree
2
# #LeetCode_75_Binary_Tree/DFS #Level_2_Day_7_Tree #Big_O_Time_O(n)_Space_O(n)
3
-# #2025_07_25_Time_6_ms_(68.63%)_Space_18.23_MB_(71.08%)
+# #2025_07_26_Time_0_ms_(100.00%)_Space_18.23_MB_(71.00%)
4
5
# Definition for a binary tree node.
6
# class TreeNode:
@@ -9,7 +9,7 @@
9
# self.left = left
10
# self.right = right
11
class Solution:
12
- def pathSum(self, root: TreeNode, targetSum: int) -> int:
+ def pathSum(self, root: Optional[TreeNode], targetSum: int) -> int:
13
def dfs(node: TreeNode, targetSum: int, curr_sum: int) -> None:
14
if not node:
15
return
0 commit comments