Sequence Reconstruction
Difficulty: Medium
Category: DSA
Topics: Array, Graph, Topological Sort
Asked at: Google
You are given an integer array `org` of length `n`, which is a permutation of the integers from `1` to `n`. You are also given a list of sequences `seqs`, where each `seqs[i]` is a subsequence of `org`.
A sequence can be **uniquely reconstructed** from `seqs` if it is the shortest common supersequence of all sequences in `seqs` (i.e., it contains all sequences in `seqs` as subsequences) and there is no other sequence that satisfies this property.
Return _true_ if `org` can be uniquely reconstructed from `seqs`. Otherwise, return _false_.
**Constraints:**
- `1 <= n <= 10^4`
- `org` is a permutation of the integers from `1` to `n`
- All elements in `seqs` are integers in the range `[1, n]`
- The length of each `seqs[i]` is at least 1 and fits in a 32-bit signed integer