排序
文章平均质量分 77
nicaishibiantai
这个作者很懒,什么都没留下…
展开
-
Lintcode - sort colors II
Given an array of n objects with k different colors (numbered from 1 to k), sort them so that objects of the same color are adjacent, with the colors in the order 1, 2, ... k.NoteYou are not s原创 2015-01-30 14:02:34 · 3454 阅读 · 1 评论 -
Lintcode - Sort Letters by Case
Given a string which contains only letters. Sort it by lower case first and upper case second.NoteIt's not necessary to keep the original order of lower-case letters and upper case letters.原创 2015-02-08 07:16:17 · 1981 阅读 · 0 评论 -
Lintcode - MedianII
Numbers keep coming, return the median of numbers at every time a new number added.ExampleFor numbers coming list: [1, 2, 3, 4, 5], return [1, 1, 2, 2, 3]For numbers coming list: [4, 5, 1, 3原创 2015-02-08 06:57:48 · 827 阅读 · 0 评论 -
Largest Number
Given a list of non negative integers, arrange them such that they form the largest number.For example, given [3, 30, 34, 5, 9], the largest formed number is 9534330.Note: The result may be ve原创 2015-03-29 12:49:03 · 368 阅读 · 0 评论 -
Lintcode - kth largest element
Find K-th largest element in an array.NoteYou can swap elements in the arrayExampleIn array [9,3,2,4,8], the 3th largest element is 4ChallengeO(n) time, O(1) space原创 2015-01-30 12:07:30 · 1823 阅读 · 0 评论