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" 这个博客说的很好,很优秀,解法全面,有空应该看下...
Say given input string:ABCDE If we solve it recursively, look at the recursion tree, we will be solving the sub-problems repeatedly. Longest Palindromic Subsequence - Overlapping Subproblems So while using the dynamic programming, we will solve it inbottom-up mannerand store the results of sub-...