leetcode_5. Longest Palindromic Substring ? 待解决

来源:互联网 发布:cepii世界贸易数据库 编辑:程序博客网 时间:2024/06/03 15:48

Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.

Example:

Input: “babad”

Output: “bab”

Note: “aba” is also a valid answer.
Example:

Input: “cbbd”

Output: “bb”

提示:提交代码后,需要用简洁的语言解释一下代码思路~ 谢谢

历史题目和总结见公众号「每日一道算法题」

https://leetcode.com/problems/longest-palindromic-substring/description/

思路