LeetCode
文章平均质量分 55
Phantomape
这个作者很懒,什么都没留下…
展开
-
Insert Delete GetRandom O(1)
DescriptionDesign a data structure that supports all following operations in average O(1) time.Note: Duplicate elements are allowed. insert(val): Inserts an item val to the collection. remove(val): R原创 2017-02-26 10:42:38 · 380 阅读 · 0 评论 -
STL: lower_bound(·) and upper_bound(·)
lower bound and upper bound function in STL原创 2016-12-11 02:59:58 · 411 阅读 · 0 评论 -
Reconstruct Original Digits from English
Reconstruct original digits from english原创 2017-01-20 11:55:02 · 315 阅读 · 0 评论 -
About LFU cache and LRU cache
LRU Cache and LFU Cache原创 2016-12-10 06:52:17 · 423 阅读 · 0 评论 -
Top K Frequent Elements
Given a non-empty array of integers, return the k most frequent elements.原创 2016-12-10 05:10:06 · 384 阅读 · 0 评论 -
Regular Expression Matching
Algorithm原创 2016-12-05 10:33:27 · 278 阅读 · 0 评论 -
Reservoir sampling
Reservoir sampling原创 2016-12-11 08:39:37 · 405 阅读 · 0 评论 -
permutation and its variations
Permutations原创 2016-12-11 08:31:44 · 287 阅读 · 0 评论 -
LeetCode: Palindrome Pairs
LeetCode: Palindrome Pairs原创 2016-03-27 22:37:45 · 421 阅读 · 0 评论 -
LeetCode: Single Number
This problem is quite similar the concept in digital circuit. First let us take a look at the code:public int singleNumber(int[] A) { if(A.length==0) { return 0; }原创 2017-03-10 05:03:09 · 370 阅读 · 0 评论