Z-Algorithm · Linear-Time Prefix Match
unseel.com · Sliding [l, r] window · O(n)
String aabxaabaab
i 0 Z[i] 0
Stage setup
Prefix letter (s[0..])
Cursor position i
[l, r] window
Match / Z[i]
Unseel.com · Z-Algorithm