manacher algorithm for finding palindromes in O(N)