Skip to content

Instantly share code, notes, and snippets.

@theabbie
Created May 9, 2022 09:42
Show Gist options
  • Save theabbie/0510e3effcd8e43502d69be11e58b408 to your computer and use it in GitHub Desktop.
Save theabbie/0510e3effcd8e43502d69be11e58b408 to your computer and use it in GitHub Desktop.
First Missing Positive
class Solution:
def first_missing_positive(self, a):
a = set(a)
a.add(0)
for i in range(1, max(a) + 2):
if i not in a:
return i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment