use manacher algorithm O(n)