题目: Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longe....
分类:
其他好文 时间:
2015-10-04 17:09:04
阅读次数:
165
Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.For "(()", the lon...
分类:
其他好文 时间:
2015-10-04 11:08:11
阅读次数:
141
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo...
分类:
其他好文 时间:
2015-10-04 00:21:09
阅读次数:
211
题目描述:(链接)Given an unsorted array of integers, find the length of the longest consecutive elements sequence.For example,Given[100, 4, 200, 1, 3, 2],The...
分类:
其他好文 时间:
2015-10-02 22:31:31
阅读次数:
196
题目: Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating lette....
分类:
其他好文 时间:
2015-10-02 06:35:32
阅读次数:
197
[Problem]Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique l...
分类:
其他好文 时间:
2015-10-02 00:11:38
阅读次数:
194
Description:Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeatin...
分类:
其他好文 时间:
2015-09-30 00:56:24
阅读次数:
145
1:回文有两种方式,第一种是中间那个字符有奇数个,第二种是中间的字符有偶数个,对于每个字符,从这个字符开始,begin递减,end递增,判断s[begin]和s[end]是否相等,返回相等的子串。 2:遍历字符串中每个字符...
分类:
其他好文 时间:
2015-09-29 23:43:03
阅读次数:
371
题目链接:https://projecteuler.net/problem=71Ifn2;q--){ p = (a*q-1)/b; if(p*s>r*q){ s = q; r = p; ...
分类:
其他好文 时间:
2015-09-27 22:46:23
阅读次数:
212
方法:动态规划 《算法导论》P208最优子结构 +重叠子问题设xi,yi,为前i个数(前缀)设c[i,j]为xi,yi的LCS的长度c[i,j] = 0 (i ==0 || j == 0)c[i,j] = a[i-1,j-1] + 1 (i,j>0 &&xi=yi)c[i,j] = max(c[i,...
分类:
其他好文 时间:
2015-09-26 23:56:22
阅读次数:
213