Longest Palindrome (dynamic programming)