
Essay String Algorithms
Z-Function vs KMP Failure Function in String Problems
Z-function works forward, KMP looks back—pick the one that matches your problem's natural direction.
Competitive Programming Review
String Algorithms
It only encodes what has already been confirmed about the string's self-overlap up to that point.