Movatterモバイル変換


[0]ホーム

URL:


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

Commitb269670

Browse files
refactor 538
1 parentb4e6ab7 commitb269670

File tree

1 file changed

+2
-4
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+2
-4
lines changed

‎src/main/java/com/fishercoder/solutions/_538.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,8 @@ private int dfs(TreeNode root, int val) {
4141
if (root ==null) {
4242
returnval;
4343
}
44-
intright =dfs(root.right,val);
45-
root.val +=right;
46-
intleft =dfs(root.left,root.val);
47-
returnleft;
44+
root.val +=dfs(root.right,val);
45+
returndfs(root.left,root.val);
4846
}
4947
}
5048

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp