Category
Level
Manacher's algorithm finds the length of the longest palindrome centered at every position in a string in linear time O(n).