Z algorithm: computes the array Z[..], where Z[i] is the length of the longest text prefix of text[i..] that is **also a prefix** of text. It runs in O(n) time, maintaining the invariant that l <= i and text[0..r-l] == text[l..r]. It can be embedded in a larger algorithm, or used for string searching as an alternative to KMP. # Example ``` use contest_algorithms::string_proc::z_algorithm; let z
(text: &[impl Eq])
source not stored for this graph (policy: none)