Manacher

Longestpalindrome