Longest Palindromic Substring
A palindrome is a nonempty string over some alphabet that reads the same forward and backward. Examples of palindromes are all strings of length 1, civic, racecar, and aibohphobia (fear of palindromes). Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example 1: Input: "babad" Output: "bab" Note: "aba" is also a valid answer. Example 2: Input: "cbbd" Output: "bb" Let p[i][j] be a table that states whether the substring si…sj is a palindrome or not. Note that any substring of length=1 can be considered as a palindrome. The following equation describes the recurrence. p[i][j]={true,if l=1si==sj,if l=2p[i+1][j−1]andsi==sj,if len>2 Procedure LONGEST-PALINDROME-SUBSTRING takes a String as it’s input. It stores $p[...