摘要: Given an unsorted integer array, find the first missing positive integer.For example,Given[1,2,0]return3,and[3,4,-1,1]return2.Your algorithm should ru... 阅读全文
posted @ 2014-12-10 12:23 ElephantKing 阅读(79) 评论(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].解题思路:先按左端点排序,然... 阅读全文
posted @ 2014-12-10 12:14 ElephantKing 阅读(94) 评论(0) 推荐(0)
摘要: Given an unsorted array of integers, find the length of the longest consecutive elements sequence.For example,Given[100, 4, 200, 1, 3, 2],The longest ... 阅读全文
posted @ 2014-12-10 00:58 ElephantKing 阅读(87) 评论(0) 推荐(0)