Skip to content

Commit 118277b

Browse files
refactor 549
1 parent d8b16eb commit 118277b

File tree

1 file changed

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

1 file changed

+0
-24
lines changed

src/main/java/com/fishercoder/solutions/_549.java

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,6 @@
22

33
import com.fishercoder.common.classes.TreeNode;
44

5-
/**
6-
* 549. Binary Tree Longest Consecutive Sequence II
7-
*
8-
* Given a binary tree, you need to find the length of Longest Consecutive Path in Binary Tree.
9-
Especially, this path can be either increasing or decreasing. For example, [1,2,3,4] and [4,3,2,1] are both considered valid,
10-
but the path [1,2,4,3] is not valid. On the other hand, the path can be in the child-Parent-child order, where not necessarily be parent-child order.
11-
12-
Example 1:
13-
Input:
14-
1
15-
/ \
16-
2 3
17-
Output: 2
18-
19-
Explanation: The longest consecutive path is [1, 2] or [2, 1].
20-
Example 2:
21-
Input:
22-
2
23-
/ \
24-
1 3
25-
Output: 3
26-
Explanation: The longest consecutive path is [1, 2, 3] or [3, 2, 1].
27-
Note: All the values of tree nodes are in the range of [-1e7, 1e7].
28-
*/
295
public class _549 {
306

317
public static class Solution1 {

0 commit comments

Comments
 (0)