2015年6月12日
摘要: Given an array withnobjects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, wh... 阅读全文
posted @ 2015-06-12 21:14 gone~with~wind 阅读(129) 评论(0) 推荐(0) 编辑
摘要: Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.1~9: {"I", "II", "III", "IV", "V", "VI", "VI... 阅读全文
posted @ 2015-06-12 15:01 gone~with~wind 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 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].思路一:逐一添加元素至ans... 阅读全文
posted @ 2015-06-12 14:34 gone~with~wind 阅读(116) 评论(0) 推荐(0) 编辑
摘要: Givennnon-negative integersa1,a2, ...,an, where each represents a point at coordinate (i,ai).nvertical lines are drawn such that the two endpoints of ... 阅读全文
posted @ 2015-06-12 13:35 gone~with~wind 阅读(106) 评论(0) 推荐(0) 编辑
摘要: Determine whether an integer is a palindrome. Do this without extra space.click to show spoilers.Some hints:Could negative integers be palindromes? (i... 阅读全文
posted @ 2015-06-12 12:59 gone~with~wind 阅读(116) 评论(0) 推荐(0) 编辑
摘要: Implementatoito convert a string to an integer.Hint:Carefully consider all possible input cases. If you want a challenge, please do not see below and ... 阅读全文
posted @ 2015-06-12 00:59 gone~with~wind 阅读(120) 评论(0) 推荐(0) 编辑