it seems to be O(n) time and memory..

```
int firstMissingPositive(int* nums, int numsSize) {
int i=0 ;
char *f = malloc(numsSize+1);
bzero(f, numsSize+1);
for (i=0;i<numsSize;i++)
{
if (nums[i]>0 && nums[i]<=numsSize)f[nums[i]]=1;
}
for (i=1;i<=numsSize;i++)
if (f[i] == 0) break ;
free(f) ;
return i ;
}
```