class Solution(object):

```
def firstMissingPositive(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
if not nums or sorted(nums)[-1]<1: return 1
for i in range(1,sorted(nums)[-1]+1):
if i not in nums: return i
return i+1
```