CP Python LibraryGitHub

Z Algorithm

Calculates the length of the longest common prefix of S and S[i:] for all i.

z_algorithm

Arguments

Returns

Complexities

Code Test