Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example: Example: 当然还有更逆天的算法,来自dis ...
分类:
其他好文 时间:
2017-12-13 00:07:17
阅读次数:
139
题目地址: https://leetcode.com/problems/longest-palindromic-substring/description/ 题目: 其实就是求一个字符串的最长回文子字符串。 解法: 我首先采取了暴力解法,不出意料地TLE了。这是超时的TLE解法: 这类题目一看就是用 ...
分类:
其他好文 时间:
2017-12-03 18:08:43
阅读次数:
134
Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example: Example: 题目描述:给定字符串,求出最大的 ...
分类:
其他好文 时间:
2017-12-03 17:12:36
阅读次数:
111
Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example: Example: 1. O(n2 * l)复杂度做 ...
分类:
其他好文 时间:
2017-12-02 11:15:19
阅读次数:
120
A number that will be the same when it is written forwards or backwards is known as a Palindromic Number. For example, 1234321 is a palindromic number ...
分类:
其他好文 时间:
2017-12-01 23:27:19
阅读次数:
106
Given a string S, find the number of different non-empty palindromic subsequences in S, and return that number modulo 10^9 + 7. A subsequence of a str ...
分类:
其他好文 时间:
2017-12-01 15:13:58
阅读次数:
766
Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example: 寻找最长回文字符串。 用动态规划。dp[i][j] ...
分类:
其他好文 时间:
2017-11-29 16:09:05
阅读次数:
140
class Solution { public: string longestPalindrome(string s) { int len=s.size(); int left,right; int begin=0,maxlen=0; if(len=0&&rightmaxlen) { ... ...
分类:
其他好文 时间:
2017-11-25 20:01:42
阅读次数:
113
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: "b ...
分类:
其他好文 时间:
2017-11-04 14:54:23
阅读次数:
147
Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example: Example: ...
分类:
其他好文 时间:
2017-10-27 01:37:34
阅读次数:
137