
数组
景行cmy
这个作者很懒,什么都没留下…
展开
-
leetcode 41. First Missing Positive
Given an unsorted integer array, find the smallest missingpositive integer.Example 1:Input: [1,2,0]Output: 3Example 2:Input: [3,4,-1,1]Output: 2Example 3:Input: [7,8,9,11,12]Outpu...转载 2019-07-15 10:25:35 · 88 阅读 · 0 评论 -
leetcode 57. Insert Interval
Given a set ofnon-overlappingintervals, insert a new interval into the intervals (merge if necessary).You may assume that the intervals were initially sorted according to their start times.Examp...原创 2019-07-15 13:43:57 · 92 阅读 · 0 评论 -
leetcode 128. Longest Consecutive Sequence
Given an unsorted array of integers, find the length of the longest consecutive elements sequence.Your algorithm should run in O(n) complexity.Example:Input:[100, 4, 200, 1, 3, 2]Output: 4Ex...原创 2019-07-15 14:56:05 · 117 阅读 · 0 评论 -
leetcode 381. Insert Delete GetRandom O(1) - Duplicates allowed
Design a data structure that supports all following operations inaverageO(1)time.Note: Duplicate elements are allowed.insert(val): Inserts an item val to the collection. remove(val): Remove...原创 2019-07-15 16:34:53 · 108 阅读 · 0 评论