Skip to content

Instantly share code, notes, and snippets.

@M0r13n
Created August 12, 2023 09:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save M0r13n/199b8f7fc79de797edc5f2a4cd41b671 to your computer and use it in GitHub Desktop.
Save M0r13n/199b8f7fc79de797edc5f2a4cd41b671 to your computer and use it in GitHub Desktop.
Eif sein Problem
from typing import List
class Solution:
def firstMissingPositive(self, nums: List[int]) -> int:
return 0
if __name__ == '__main__':
assert Solution().firstMissingPositive([2,1,0]) == 3
assert Solution().firstMissingPositive([1,2,0]) == 3
assert Solution().firstMissingPositive([3,4,-1,1]) == 2
assert Solution().firstMissingPositive([7,8,9,11,12]) == 1
assert Solution().firstMissingPositive([7,2,4,1,4,9]) == 3
assert Solution().firstMissingPositive([5,4,3,2,1]) == 6
assert Solution().firstMissingPositive([1,2,3,4,5]) == 6
assert Solution().firstMissingPositive([0,-1,3,1]) == 2
assert Solution().firstMissingPositive([7,9,5,1,2,4,5]) == 3
assert Solution().firstMissingPositive([3, 4, 2, -1, 0, 1]) == 5
numbers = [8,9,3,4,5,6,7,1,2,0]
assert Solution().firstMissingPositive(numbers) == 10
numbers = [99,94,96,11,92,5,91,89,57,85,66,63,84,81,79,61,74,78,77,30,64,13,58,18,70,69,51,12,32,34,9,43,39,8,1,38,49,27,21,45,47,44,53,52,48,19,50,59,3,40,31,82,23,56,37,41,16,28,22,33,65,42,54,20,29,25,10,26,4,60,67,83,62,71,24,35,72,55,75,0,2,46,15,80,6,36,14,73,76,86,88,7,17,87,68,90,95,93,97,98]
assert Solution().firstMissingPositive(numbers) == 100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment