Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

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
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #return #missing #element #python
ADD COMMENT
Topic
Name
7+1 =