LeetCode p5 Longest Palindromic Substring 题解
1.题目:
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”
题意:
输入一个字符串,输出他的最长回文子串。
2.解题思路:
dp
见代码orz。。以前做过这题的感觉。
3.代码
1 |
|
4.一些总结:
leetcode 200斩。。一只努力奋斗的渣渣