```
class Solution(object):
def firstMissingPositive(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
if len(nums)>0:
maxi = max(nums)
if maxi>0:
for i in range(0,maxi):
if i in nums:
continue
elif i>0:
return i
else:
return maxi+1
if maxi <= 0:
return 1
else:
return 1
```