归档 2015年9月14日

[LeetCode]First Missing Positive

题目描述:

Given an unsorted integer array, find the first missing positive integer.

For example,
Given [1,2,0] return 3,
and [3,4,-1,1] return 2.

Your algorithm should run in O(n) time and uses constant space.

题目大意:

给定一个未经排序的数组,寻找第一个缺失的正整数。

例如,
给定 [1,2,0] 返回3,
给定 ...

继续阅读

昨天

明天

归档