Skip to content

Commit 5bdcfd7

Browse files
refactor 366
1 parent a20b87b commit 5bdcfd7

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

-30
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,6 @@
55
import java.util.ArrayList;
66
import java.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
public class _366 {
399

4010
public static class Solution1 {

0 commit comments

Comments
 (0)