```
class Solution(object):
def firstMissingPositive(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
nums = list(set(nums))
nums.sort()
now = 0
for i in range(len(nums)):
if nums[i]>0:
if nums[i]!= now+1:
return now+1
else:
now = now+1
if now==0:
return 1
return now+1
```