LOL so easy for 300


#1
int Solution::firstMissingPositive(vector<int> &A) {
int n=A.size(),i;
vector<int> arr(n+1,0);
for(i=0;i<n;i++)
{
    if(A[i]<=0)
    continue;
    if(A[i]<=n)
    arr[A[i]]=1;
}
for(i=1;i<n+1;i++)
    if(arr[i]==0)
        break;
return i;

}


#2

LOL! The required solution is O(1) space. Yours is O(N).