```
class Solution(object):
def firstMissingPositive(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
if nums:
s = []
maximum = max(nums)
minimum = min(nums)
i = minimum
while i<=maximum:
s.append(i)
i += 1
l = len(s)
if minimum>=2:
return 1
elif minimum<2:
for j in range(l):
if s[j]>0 and s[j] not in nums:
return s[j]
break
else:
continue
return (maximum+1)
else:
return 1
```