A palindrome is a string that is the same as its reverse. The following strings are examples of palindromes: abba, refer, 0101010, x. A substring of a string X = x1, x2, x3, . . . , xn
is a string Y = y1, y2, . . . , yk
such that y1 = xi1 , y2 = xi2 , . . . , yk = xik and i1 < i2 < . . . ik
.
For example, 2, 7, 4 is a substring of 1, 2, 8, 7, 4. Design the most efficient dynamic programming algorithm that you can that inputs a string X of length n and finds the length of the longest substring of X that is a palindrome. Can this problem be solved in O(n^2) time?