摘要: 703 非常经典的一个题,假设有一个不断增加的序列,要求输出第K 大的数 215 太简单了,就不说了。 阅读全文
posted @ 2019-01-15 04:32 KeepAC 阅读(83) 评论(0) 推荐(0) 编辑
摘要: 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 阅读(98) 评论(0) 推荐(0) 编辑
摘要: 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 阅读(106) 评论(0) 推荐(0) 编辑
摘要: 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 阅读(81) 评论(0) 推荐(0) 编辑