5. Longest Palindromic Substring
题目描述
Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.
|
|
Note: “aba” is also a valid answer.
|
|
题目大意
最长的回文子字符串。
解题思路
遍历字符串,使用双指针的方式。
第一步:移动右指针找到第一个与左指针不相同的
第二步:移动左右指针,判断是否是回文数
第二步:判断是否是当前最大回文数
代码
|
|