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

Lines changed: 0 additions & 30 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy