Category
Level
The Z-function of a string S computes for each position i the length of the longest substring starting at i that matches the prefix of S.