
排序
文章平均质量分 74
sscssz
这个作者很懒,什么都没留下…
展开
-
164. Maximum Gap【H】【80】【桶排序】【VIP】
Given an unsorted array, find the maximum difference between the successive elements in its sorted form. Try to solve it in linear time/space. Return 0 if the array contains less than 2 elements原创 2016-05-13 21:55:49 · 649 阅读 · 0 评论 -
324. Wiggle Sort II【M】【33】
Given an unsorted array nums, reorder it such that nums[0] nums[2] . Example: (1) Given nums = [1, 5, 1, 1, 6, 4], one possible answer is [1, 4, 1, 5, 1, 6]. (2) Given nums = [1, 3, 2, 2,原创 2016-05-18 20:24:35 · 333 阅读 · 0 评论 -
56. Merge Intervals【H】【67】
Given a collection of intervals, merge all overlapping intervals. For example, Given [1,3],[2,6],[8,10],[15,18], return [1,6],[8,10],[15,18]. Subscribe to see which companies asked t原创 2016-06-04 15:41:28 · 333 阅读 · 0 评论 -
57. Insert Interval【H】【67】
Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary). You may assume that the intervals were initially sorted according to their start times. E原创 2016-06-04 15:55:09 · 317 阅读 · 0 评论 -
【leetcode】414. Third Maximum Number【E】【85】
Given a non-empty array of integers, 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). Example 1: Input: [3, 2,原创 2016-10-29 15:11:52 · 558 阅读 · 0 评论 -
【leetcode】455. Assign Cookies【E】
Assume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie. Each child i has a greed factor gi, which is the minimum size of a c原创 2016-11-16 11:04:10 · 597 阅读 · 0 评论 -
【leetcode】435. Non-overlapping Intervals【M】
Given a collection of intervals, find the minimum number of intervals you need to remove to make the rest of the intervals non-overlapping. Note: You may assume the interval's end point is alw原创 2016-11-18 10:18:20 · 465 阅读 · 0 评论 -
【LeetCode】451. Sort Characters By Frequency【M】【68】
Given a string, sort it in decreasing order based on the frequency of characters. Example 1: Input: "tree" Output: "eert" Explanation: 'e' appears twice while 'r' and 't' both appear once. So 'e原创 2017-02-19 10:30:50 · 459 阅读 · 0 评论 -
【LeetCode】506. Relative Ranks【E】【50】
Given scores of N athletes, find their relative ranks and the people with the top three highest scores, who will be awarded medals: "Gold Medal", "Silver Medal" and "Bronze Medal". Example 1: In原创 2017-02-24 21:47:34 · 823 阅读 · 0 评论