answers the question:

If we have matched P[1..q] in T, but P[q+1] does not match, then what is the longest prefix of P, P[1..k], that is a suffix of P[1..q]?

We can then start matching again from P[k+1].

= max{k k < q and P[1..k] is a suffix of
P[1..q]}

**Example**