fork download
  1. def solution(A, N) -> int:
  2. i = 1
  3. while True:
  4. if i not in A:
  5. return i
  6. i += 1
  7.  
  8. assert solution([1, 3, 6, 4, 1, 2], 6) == 5
  9. assert solution([1, 2, 3], 3) == 4
  10. assert solution([-1, -3], 2) == 1
Success #stdin #stdout 0.04s 9408KB
stdin
Standard input is empty
stdout
Standard output is empty