Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring. 思路:如果不用动态规划,在两个for循环的情况下,还得依次比较i,j间的每个字符,O(n3).使用动态规划,O(n2) char* longestPa…