Manacher’s Algorithm

and 5. Longest Palindromic Substring