Skip to content

Commit 58a106b

Browse files
refactor 1367
1 parent 8e8dfcd commit 58a106b

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

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

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,6 @@
66
import java.util.ArrayList;
77
import java.util.List;
88

9-
/**
10-
* 1367. Linked List in Binary Tree
11-
*
12-
* Given a binary tree root and a linked list with head as the first node.
13-
* Return True if all the elements in the linked list starting from the head correspond to some downward path
14-
* connected in the binary tree otherwise return False.
15-
* In this context downward path means a path that starts at some node and goes downwards.
16-
*
17-
* Example 1:
18-
* Input: head = [4,2,8], root = [1,4,4,null,2,2,null,1,null,6,8,null,null,null,null,1,3]
19-
* Output: true
20-
* Explanation: Nodes in blue form a subpath in the binary Tree.
21-
*
22-
* Example 2:
23-
* Input: head = [1,4,2,6], root = [1,4,4,null,2,2,null,1,null,6,8,null,null,null,null,1,3]
24-
* Output: true
25-
*
26-
* Example 3:
27-
* Input: head = [1,4,2,6,8], root = [1,4,4,null,2,2,null,1,null,6,8,null,null,null,null,1,3]
28-
* Output: false
29-
* Explanation: There is no path in the binary tree that contains all the elements of the linked list from head.
30-
*
31-
* Constraints:
32-
* 1 <= node.val <= 100 for each node in the linked list and binary tree.
33-
* The given linked list will contain between 1 and 100 nodes.
34-
* The given binary tree will contain between 1 and 2500 nodes.
35-
* */
369
public class _1367 {
3710
public static class Solution1 {
3811
List<List<Integer>> paths = new ArrayList<>();

0 commit comments

Comments
 (0)