Skip to content

Commit b407a15

Browse files
refactor 444
1 parent 5ee0e5b commit b407a15

File tree

1 file changed

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

1 file changed

+0
-46
lines changed

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

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -8,52 +8,6 @@
88
import java.util.Queue;
99
import java.util.Set;
1010

11-
/**
12-
* 444. Sequence Reconstruction
13-
*
14-
* Check whether the original sequence org can be uniquely reconstructed from the sequences in seqs.
15-
* The org sequence is a permutation of the integers from 1 to n, with 1 ≤ n ≤ 104.
16-
* Reconstruction means building a shortest common supersequence of the sequences in seqs
17-
* (i.e., a shortest sequence so that all sequences in seqs are subsequences of it).
18-
* Determine whether there is only one sequence that can be reconstructed from seqs and it is the org sequence.
19-
20-
Example 1:
21-
Input:
22-
org: [1,2,3], seqs: [[1,2],[1,3]]
23-
24-
Output:
25-
false
26-
27-
Explanation:
28-
[1,2,3] is not the only one sequence that can be reconstructed, because [1,3,2] is also a valid sequence that can be reconstructed.
29-
30-
Example 2:
31-
Input:
32-
org: [1,2,3], seqs: [[1,2]]
33-
34-
Output:
35-
false
36-
37-
Explanation:
38-
The reconstructed sequence can only be [1,2].
39-
40-
Example 3:
41-
Input:
42-
org: [1,2,3], seqs: [[1,2],[1,3],[2,3]]
43-
44-
Output:
45-
true
46-
47-
Explanation:
48-
The sequences [1,2], [1,3], and [2,3] can uniquely reconstruct the original sequence [1,2,3].
49-
50-
Example 4:
51-
Input:
52-
org: [4,1,5,2,6,3], seqs: [[5,2,6,3],[4,1,5,2]]
53-
54-
Output:
55-
true
56-
*/
5711
public class _444 {
5812
public static class Solution1 {
5913
/**

0 commit comments

Comments
 (0)