Skip to content

Commit d680e09

Browse files
authored
Merge pull request doocs#114 from ashwek/1missing
0041 First Missing Positive - Python
2 parents db923f6 + b2cb551 commit d680e09

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class Solution:
2+
def firstMissingPositive(self, nums):
3+
"""
4+
:type nums: List[int]
5+
:rtype: int
6+
"""
7+
8+
i = 1
9+
while i in nums:
10+
i += 1
11+
return i

0 commit comments

Comments
 (0)