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 longest ...
分类:
其他好文 时间:
2015-05-13 00:42:12
阅读次数:
100
Longest Palindromic SubstringGiven a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substrin...
分类:
其他好文 时间:
2015-05-12 23:09:34
阅读次数:
163
发现自己原来掌握的一下算法,都忘掉了,啊啊啊------------------------------------------------------------------------------------------------------Longest Palindromic Subst....
分类:
其他好文 时间:
2015-05-12 22:47:52
阅读次数:
217
题目:Given a string containing just the characters'('and')', find the length of the longest valid (well-formed) parentheses substring.For"(()", the long...
分类:
其他好文 时间:
2015-05-12 20:40:49
阅读次数:
88
Write a function to find the longest common prefix string amongst an array of strings.
class Solution {
public:
string longestCommonPrefix(vector& strs) {
if(strs.size()==0) return "";
...
分类:
其他好文 时间:
2015-05-12 09:37:20
阅读次数:
112
public class Solution { public String longestPalindrome(String s) { if (s == null || s.length() == 0) { return null; } ...
分类:
其他好文 时间:
2015-05-12 09:16:55
阅读次数:
161
一.问题描述:最长公共子串(LCS-Longest Common Substring)LCS问题就是求两个字符串最长公共子串的问题。比如输入两个字符串"ilovechina"和“chinabest”的最长公共字符串有"china",它们的长度是5.二.解法解法就是用一个矩阵来记录两个字符串中所有位置...
分类:
其他好文 时间:
2015-05-12 01:21:18
阅读次数:
108
我的错误代码: 1 #include 2 3 using namespace std; 4 5 int longestValidParentheses(string s) 6 { 7 int i = 0; 8 int L = s.length(); 9 int j;10 ...
分类:
其他好文 时间:
2015-05-11 12:54:52
阅读次数:
96
Longest Valid Parentheses问题:Given a string containing just the characters'('and')', find the length of the longest valid (well-formed) parentheses sub...
分类:
其他好文 时间:
2015-05-11 12:27:10
阅读次数:
110
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 longest ...
分类:
其他好文 时间:
2015-05-11 12:14:42
阅读次数:
116