Amazon Interview Question

solve longest palindrome in O(n)