Z-Algorithm ·
Linear-Time Prefix Match
un
seel
.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]
Play
Pause
Unmute
Reset
Un
seel
.com · Z-Algorithm