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

Commit5bdcfd7

Browse files
refactor 366
1 parenta20b87b commit5bdcfd7

File tree

1 file changed

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

1 file changed

+0
-30
lines changed

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

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,6 @@
55
importjava.util.ArrayList;
66
importjava.util.List;
77

8-
/**
9-
* 366. Find Leaves of Binary Tree
10-
*
11-
* Given a binary tree, collect a tree's nodes as if you were doing this:
12-
* Collect and remove all leaves, repeat until the tree is empty.
13-
14-
Example:
15-
Given binary tree
16-
1
17-
/ \
18-
2 3
19-
/ \
20-
4 5
21-
Returns [4, 5, 3], [2], [1].
22-
23-
Explanation:
24-
1. Removing the leaves [4, 5, 3] would result in this tree:
25-
26-
1
27-
/
28-
2
29-
2. Now removing the leaf [2] would result in this tree:
30-
31-
1
32-
3. Now removing the leaf [1] would result in the empty tree:
33-
34-
[]
35-
Returns [4, 5, 3], [2], [1].
36-
37-
*/
388
publicclass_366 {
399

4010
publicstaticclassSolution1 {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp