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

Commit826c876

Browse files
refactor 543
1 parent4c2221c commit826c876

File tree

1 file changed

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

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ public class _543 {
66

77
publicstaticclassSolution1 {
88
/**
9+
* A great observation of this problem is that the longest path must exist between two leaf nodes,
10+
* since it's easy to prove its opposite is not the longest by simply adding one to reach its leaf node.
11+
*
12+
* <p>
913
* This is a very great problem for practicing recursion:
1014
* 1. What dfs() returns is the max height it should pick from either its left or right subtree, that's
1115
* what the int return type stands for;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp