The solution for the subword pair $(i..j,k..l)$ is stored at $M[i,j,k,l]$ where $M$ is a four-dimensional matrix. This results in severe space loss as the cells representing invalid subwords ($i>j$ or $k>l$) or overlapping subwords are never filled. Compare this with the strategy that eliminates the space loss of invalid subwords.

The visualization fixes the first subword and then displays the two-dimensional matrix for it. See also an alternative visualization.

Delay: (try 0!)

(note: doesn’t affect a running animation)

Word length:
First subword: