Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 08169ce

Browse files
Update 0112.路径总和.md
1\ return 的位置错误 2\ 第二个traversal的输入值错误
1 parent cc5a2fe commit 08169ce

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎problems/0112.路径总和.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ class solution:
499499
if not cur_node.left and not cur_node.right:
500500
if remain == 0:
501501
result.append(path[:])
502-
return
502+
return
503503

504504
if cur_node.left:
505505
path.append(cur_node.left.val)
@@ -508,7 +508,7 @@ class solution:
508508

509509
if cur_node.right:
510510
path.append(cur_node.right.val)
511-
traversal(cur_node.right, remain-cur_node.left.val)
511+
traversal(cur_node.right, remain-cur_node.right.val)
512512
path.pop()
513513

514514
result, path = [], []

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /