We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2450461 commit d0cbe75Copy full SHA for d0cbe75
Algorithms/0437.path-sum-iii/path-sum-iii.go
@@ -11,7 +11,7 @@ func pathSum(root *TreeNode, sum int) int {
11
return 0
12
}
13
14
- res := 0
+ cnt := 0
15
16
var dfs func(*TreeNode, int)
17
dfs = func(node *TreeNode, sum int) {
@@ -21,7 +21,7 @@ func pathSum(root *TreeNode, sum int) int {
21
22
sum -= node.Val
23
if sum == 0 {
24
- res++
+ cnt++
25
26
27
dfs(node.Left, sum)
@@ -30,7 +30,7 @@ func pathSum(root *TreeNode, sum int) int {
30
31
dfs(root, sum)
32
33
- return res +
+ return cnt +
34
pathSum(root.Left, sum) +
35
pathSum(root.Right, sum)
36
0 commit comments