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-11-29 12:08:03
阅读次数:
142
问题:Given 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 lon...
分类:
其他好文 时间:
2015-11-27 17:11:12
阅读次数:
131
C++ 1 class Solution { 2 public: 3 /** 4 * @param dictionary: a vector of strings 5 * @return: a vector of strings 6 */ 7 vecto...
分类:
其他好文 时间:
2015-11-27 06:40:42
阅读次数:
174
Another Longest Increasing Subsequence ProblemTime Limit: 20 SecMemory Limit: 256 MB题目连接http://acm.hust.edu.cn/vjudge/problem/visitOriginUrl.action?id...
分类:
其他好文 时间:
2015-11-26 23:07:13
阅读次数:
198
翻译给定一个仅仅包含“(”或“)”的字符串,找到其中最长有效括号子集的长度。对于“(()”,它的最长有效括号子集是“()”,长度为2。另一个例子“)()())”,它的最长有效括号子集是“()()”,其长度是4。原文Given a string containing just the characters '(' and ')',
find the length of the longest val...
分类:
其他好文 时间:
2015-11-26 19:15:52
阅读次数:
148
Longest WordsGiven a dictionary, find all of the longest words in the dictionary.ExampleGiven{ "dog", "google", "facebook", "internationalization"...
分类:
其他好文 时间:
2015-11-24 06:18:58
阅读次数:
150
问题描述:Given 2 sequences, X = x1,...,xm and Y = y1,...,yn, find a common subsequence whose length is maximum. Subsequence need not be consecutive, but m...
分类:
编程语言 时间:
2015-11-23 13:13:45
阅读次数:
207
素数非负使得前缀和单调,于是对于固定的区间尾部j,头部i也是单调的,区间和更新的时候维护一下就好。/********************************************************** ------------------ ...
分类:
其他好文 时间:
2015-11-23 09:56:20
阅读次数:
116
1、两个字符串是变位词写出一个函数anagram(s, t)去判断两个字符串是否是颠倒字母顺序构成的样例:给出 s="abcd",t="dcab",返回true;解题思路:这道题首先要明白变位词并不是指的两个单词字母顺序颠倒,指的是构成他们的字母是一样的,但是字母的位置不一样;第一种方法很容易想到通...
分类:
其他好文 时间:
2015-11-23 00:45:03
阅读次数:
196
题目链接:http://www.lintcode.com/zh-cn/problem/longest-increasing-continuous-subsequence-ii/最长上升连续子序列 II 给定一个整数矩阵(其中,有 n 行, m 列),请找出矩阵中的最长上升连续子序列。(最长上升连.....
分类:
其他好文 时间:
2015-11-22 21:44:59
阅读次数:
231