随机挑选一题试试手气。 问题描述: Given an unsorted array of integers, find the length of the longest consecutive elements sequence. For example, Given [100, 4, 200, ...
分类:
其他好文 时间:
2014-07-24 21:55:32
阅读次数:
232
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 lo...
分类:
其他好文 时间:
2014-07-24 00:49:07
阅读次数:
200
MatrixTime Limit:3000MSMemory Limit:65536KTotal Submissions:17976Accepted:6737DescriptionGiven an N*N matrix A, whose elements are either 0 or 1. A[i,...
分类:
其他好文 时间:
2014-07-23 14:47:26
阅读次数:
265
题目: Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum...
分类:
编程语言 时间:
2014-07-22 22:47:16
阅读次数:
252
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.题解:开始想到的方法比较偷懒,直接遍历一遍数组,把每个ListNode对应的值放到...
分类:
其他好文 时间:
2014-07-22 22:45:13
阅读次数:
271
题目:Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array w...
分类:
编程语言 时间:
2014-07-22 22:41:14
阅读次数:
396
Remove ElementGiven an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. ...
分类:
其他好文 时间:
2014-07-22 00:01:37
阅读次数:
221
1.Given an array where elements are sorted in ascending order, convert it to a height balanced BST.
2.Given a singly linked list where elements are sorted in ascending order, convert it to a heig...
分类:
其他好文 时间:
2014-07-21 23:45:53
阅读次数:
264
var?Map?=?function()?{
?this.elements?=?new?Array();
?this.size?=?function()?{
??return?this.elements.length;
?}
?this.isEmpty?=?function()?{
??return?(this.elements.length?...
分类:
编程语言 时间:
2014-07-21 23:30:03
阅读次数:
275
Distinct Subsequences
A subsequence of a given sequence is just the given sequence with some elements (possibly none) left out. Formally, given a sequence X = x1x2…xm,
another sequence Z = z1...
分类:
其他好文 时间:
2014-07-21 15:44:16
阅读次数:
244