![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
秋招100
laohixdxm00
这个作者很懒,什么都没留下…
展开
-
lc347 347. Top K Frequent Elements
https://leetcode-cn.com/problems/top-k-frequent-elements/[brainstorm]1 top k freq item, so there is order here.2 instead of N item, only K item, sort vs heap3 sort on count, but return number, how to get number by count?[bug]for(int i=0;i<heap.siz原创 2021-09-18 20:14:17 · 360 阅读 · 0 评论 -
lc128 128. Longest Consecutive Sequence
https://leetcode-cn.com/problems/longest-consecutive-sequence/e.g. 4 1 3 24 - 3|1 -2[brainstorm]1 union find, set grow bigger. finally, find biggest set size.2 while seeing 3,add 3 to {4}, become {3,4}3 seeing 2add 2 to {1} and {3,4}4 how to l原创 2021-09-17 16:04:03 · 101 阅读 · 0 评论