solution for longest palindrome