# One-dimensional string matching

## Input

Two ordered sequences, $S$ of length $n=|S|$ and $T$ of length $m=|T|$.

## Output

A sorted sequence $R$ of integral values from $\{ 1,...,n\}$ such that $i \in R$ if, and only if, it is $i\le n-m+1$ and $T[j]=S[i+j-1]$ for all $j \in \{ 1,...,m \}$.

N/A

Polynomial.