Matching Arrays
Array $P$ is said to **match** array $Q$, if array $Q$ can be transformed to $P$ by the use of the following action multiple times: - Choose index $1 \le i \le |Q|$, and an element $X$ such that $X \ne Q_i$, and then insert $X$ after index $i$ in array $Q$. Notably, you cannot insert any element before the first index in $Q$. You are given $2$ arrays $A$ of length $N$ and $B$ of length $M$. F
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start