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

Commit4c2221c

Browse files
refactor 543
1 parentc1a4fa7 commit4c2221c

File tree

1 file changed

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

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ private int dfs(TreeNode root) {
2727
if (root ==null) {
2828
return0;
2929
}
30-
intleft =dfs(root.left);
31-
intright =dfs(root.right);
32-
diameter =Math.max(diameter,left +right);
33-
returnMath.max(left,right) +1;
30+
intleftPath =dfs(root.left);
31+
intrightPath =dfs(root.right);
32+
diameter =Math.max(diameter,leftPath +rightPath);
33+
returnMath.max(leftPath,rightPath) +1;
3434
}
3535
}
3636
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp