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.
解法1:枚举法 O(n^2)时间复杂度 常数空间复杂度
枚举中心位置,然后再在该位置上用扩展法,记录并更新得到的最长的回文长度。(注意奇数长度和偶数长度)