Answers for "how to return a missing element in python"

0

how to return a missing element in python

def solution(A):
    return [value for value in range(min(A),max(A)) if value not in A]
Posted by: Guest on December-26-2020
0

how to return a missing element in python

def solution(A):
    a = set(A)
    for i, _ in enumerate(A, 1):
        if i in a:
            continue
        return i

solution(A)
# 3
Posted by: Guest on December-26-2020

Code answers related to "how to return a missing element in python"

Python Answers by Framework

Browse Popular Code Answers by Language