First Missing Positive

题目描述

解题方法

the missing positive integer will be in the range [1, N+1]

Creating buckets would have been an easy solution if using extra space was allowed.

An array of size N initialized to 0 would have been created.

Now, since additional space is not allowed either, the given array itself needs to be used to track it.

Solution

Reference