01 2019 档案
703. Kth Largest Element in a Stream/215. Kth Largest Element in an Array/
摘要:703 非常经典的一个题,假设有一个不断增加的序列,要求输出第K 大的数 215 太简单了,就不说了。 阅读全文
posted @ 2019-01-15 04:32 KeepAC 阅读(94) 评论(0) 推荐(0)
347. Top K Frequent Elements/692. Top K Frequent Words
摘要:Given a non-empty array of integers, return the k most frequent elements. Example 1: Example 2: Input: nums = [1], k = 1 Output: [1]非常经典的一道题,有以下几点:1. 阅读全文
posted @ 2019-01-15 03:54 KeepAC 阅读(120) 评论(0) 推荐(0)
414. Third Maximum Number
摘要:return the third maximum number in this array. If it does not exist, return the maximum number. The time complexity must be in O(n). 阅读全文
posted @ 2019-01-15 03:13 KeepAC 阅读(117) 评论(0) 推荐(0)
280. Wiggle Sort/324. Wiggle Sort II
摘要:280 Given an unsorted array nums, reorder it in-place such that nums[0] <= nums[1] >= nums[2] <= nums[3].... Example: 方法二: 上面的方法是 nlogn解法, 如何寻求一个On 的解 阅读全文
posted @ 2019-01-15 03:07 KeepAC 阅读(92) 评论(0) 推荐(0)