pub fn palindromes(text: &[impl Eq]) -> Vec<usize>
Expand description
Manacher’s algorithm for computing palindrome substrings in linear time. pal[2i] = odd length of palindrome centred at text[i]. pal[2i+1] = even length of palindrome centred at text[i+0.5].
§Panics
Panics if text is empty.