Skip to content

Commit d0cbe75

Browse files
aQuaaQua
aQua
authored and
aQua
committed
437 finish
1 parent 2450461 commit d0cbe75

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Algorithms/0437.path-sum-iii/path-sum-iii.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ func pathSum(root *TreeNode, sum int) int {
1111
return 0
1212
}
1313

14-
res := 0
14+
cnt := 0
1515

1616
var dfs func(*TreeNode, int)
1717
dfs = func(node *TreeNode, sum int) {
@@ -21,7 +21,7 @@ func pathSum(root *TreeNode, sum int) int {
2121

2222
sum -= node.Val
2323
if sum == 0 {
24-
res++
24+
cnt++
2525
}
2626

2727
dfs(node.Left, sum)
@@ -30,7 +30,7 @@ func pathSum(root *TreeNode, sum int) int {
3030

3131
dfs(root, sum)
3232

33-
return res +
33+
return cnt +
3434
pathSum(root.Left, sum) +
3535
pathSum(root.Right, sum)
3636
}

0 commit comments

Comments
 (0)