← 返回 meta 的题目列表Find Smallest Positive
类型:online_judge
Given an unsorted integer array, find the smallest missing positive integer. For example, for the array [3, 4, -1, 1], return 2. Your algorithm should run in O(n) time and uses constant extra space.
Example
Input
3
3 4 -1 1