CLR cover

Problem 138: Subsequence covers

\( \def\SMot{\mathit{Subs}} \)

A word $x$ is a subsequence cover (s-cover, in short) of a word $y$ if each position on $y$ belongs to an occurrence of $x$ as a subsequence of $y$.

Let $y$ be a word in $\{0,1,\ldots,n-1\}^n$. Design a linear-time algorithm that checks if a given word $x$ of length $m\lt n$ is an s-cover of $y$.

References