1.Longest Consecutive Sequence
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 consecu...
分类:
编程语言 时间:
2014-11-19 22:27:00
阅读次数:
447
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring
without repeating letters for "abcabcbb" is "abc", which the length is 3. Fo...
分类:
其他好文 时间:
2014-11-19 01:35:20
阅读次数:
199
Longest Common Prefix Total Accepted: 24665 Total Submissions: 92370My SubmissionsQuestionSolutionWrite a function to find the longest common prefix s...
分类:
其他好文 时间:
2014-11-18 23:35:50
阅读次数:
182
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo...
分类:
其他好文 时间:
2014-11-17 22:29:25
阅读次数:
242
3517.The longest athletic trackTime Limit:1.0 Seconds Memory Limit:65536KTotal Runs:880 Accepted Runs:342After a long time of algorithm training, we w...
分类:
其他好文 时间:
2014-11-17 11:59:05
阅读次数:
270
Longest Ordered Subsequence
Time Limit: 2000MS
Memory Limit: 65536K
Total Submissions: 34454
Accepted: 15135
Description
A numeric sequence of ai is ordered if a1 a2 ...
分类:
其他好文 时间:
2014-11-16 18:41:55
阅读次数:
202
可能是因为我是按难度顺序刷的原因,这个其实在之前的几道题里面已经写过了。题目如下: Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path...
分类:
其他好文 时间:
2014-11-15 21:31:17
阅读次数:
194
Write a function to find the longest common prefix string amongst an array of strings.(每个字符串从0开始的公共部分即最长公共前缀)C++代码如下:#include#include#includeusing nam...
分类:
其他好文 时间:
2014-11-14 23:58:14
阅读次数:
463
Given a string S, find the longest palindromic substring in S.Note:This is Part II of the article:Longest Palindromic Substring. Here, we describe an ...
分类:
其他好文 时间:
2014-11-12 21:05:22
阅读次数:
345
题意:给一个长度为n的序列,问每个数关于序列的LIS(longest increasing sequence)是什么角色。这里分了三种:
1、此数没有出现在任意一条LIS中
2、此数出现在至少一条但是不是全部的LIS中
3、此数出现在所有的LIS中
解法:nlgn的LIS算法可以求出以每个i位置结束的LIS长度up[i]。出现在L...
分类:
其他好文 时间:
2014-11-12 19:45:28
阅读次数:
214