Given an unsorted array of integers, find the length of longest increasing subsequence.For example,Given [10, 9, 2, 5, 3, 7, 101, 18],The longest incr...
分类:
其他好文 时间:
2015-12-29 06:20:54
阅读次数:
260
Given a binary tree, find the length of the longest consecutive sequence path.The path refers to any sequence of nodes from some starting node to any ...
分类:
其他好文 时间:
2015-12-29 06:19:28
阅读次数:
271
0可以表示任何1到m的数,求一个最长的连续上升序列长度因为m的范围在10w,所以以每个节点为起点 进行二分,复杂度mlogm思路:b[i]表示到 1 到 i 有几个数没有出现,二分的时候注意加等号#include#include#include#include#include#include#inc...
分类:
其他好文 时间:
2015-12-28 18:22:41
阅读次数:
121
Problem 2216 The Longest StraightAccept: 7Submit: 14 Time Limit: 1000 mSecMemory Limit : 32768 KBProblem DescriptionZB is playing a card game where th...
分类:
其他好文 时间:
2015-12-27 21:44:15
阅读次数:
583
Write a function to find the longestcommon prefix string amongst an array of strings.中文意思是:找出所有字符串的公共前缀,题目难度为easy。思路:2个字符串的公共前缀,其长度肯定不会超过最短的字符串长度,设最短的...
分类:
其他好文 时间:
2015-12-27 13:29:03
阅读次数:
159
题目:Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters...
分类:
其他好文 时间:
2015-12-27 11:58:41
阅读次数:
126
题目来源:https://leetcode.com/problems/longest-palindromic-substring/Given a stringS, find the longest palindromic substring inS. You may assume that the ...
分类:
其他好文 时间:
2015-12-25 21:02:43
阅读次数:
195
Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest le...
分类:
其他好文 时间:
2015-12-25 20:59:38
阅读次数:
167
这也能算hard题……Given a string, find the length of the longest substring T that contains at most 2 distinct characters.For example, Given s =“eceba”,T is "...
分类:
其他好文 时间:
2015-12-25 06:25:56
阅读次数:
165
1 var longestCommonPrefix = function(strs) { 2 if (strs.length < 1) { 3 return ""; 4 } 5 6 var prefix = strs[0]; 7 8 for (v...
分类:
其他好文 时间:
2015-12-24 20:37:38
阅读次数:
162