A city's skyline is the outer contour of the silhouette formed by all the buildings in that city when viewed from a distance. Now suppose you aregiven...
分类:
其他好文 时间:
2015-08-06 23:55:27
阅读次数:
204
Find thekth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element.For exampl...
分类:
其他好文 时间:
2015-08-06 22:09:52
阅读次数:
120
Find all possible combinations ofknumbers that add up to a numbern, given that only numbers from 1 to 9 can be used and each combination should be a u...
分类:
其他好文 时间:
2015-08-06 21:50:40
阅读次数:
118
Note:This is an extension ofHouse Robber.After robbing those houses on that street, the thief has found himself a new place for his thievery so that h...
分类:
其他好文 时间:
2015-08-06 21:40:39
阅读次数:
143
Given a 2D board and a list of words from the dictionary, find all words in the board.Each word must be constructed from letters of sequentially adjac...
分类:
其他好文 时间:
2015-08-06 12:35:05
阅读次数:
118
There are a total ofncourses you have to take, labeled from0ton - 1.Some courses may have prerequisites, for example to take course 0 you have to firs...
分类:
其他好文 时间:
2015-08-06 00:13:22
阅读次数:
190
Design a data structure that supports the following two operations:void addWord(word)bool search(word)search(word) can search a literal word or a regu...
分类:
其他好文 时间:
2015-08-05 23:54:49
阅读次数:
149
Trie树又被称为字典树、前缀树,是一种用于快速检索的多叉树。Tried树可以利用字符串的公共前缀来节省存储空间。但如果系统存在大量没有公共前缀的字符串,相应的Trie树将非常消耗内存。(下图为Wiki上的Trie树示意图, https://en.wikipedia.org/wiki/Trie)子节...
分类:
其他好文 时间:
2015-08-05 00:38:20
阅读次数:
165
Given an array ofnpositive integers and a positive integers, find the minimal length of a subarray of which the sum ≥s. If there isn't one, return 0 i...
分类:
其他好文 时间:
2015-08-05 00:30:29
阅读次数:
146
There are a total ofncourses you have to take, labeled from0ton - 1.Some courses may have prerequisites, for example to take course 0 you have to firs...
分类:
其他好文 时间:
2015-08-04 22:48:55
阅读次数:
119