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)
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)
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)