def solution(X, A):
check = X * [False]
sum = 0
for i, a in enumerate(A):
if check[a-1] == False:
sum +=1
check[a-1] = True
if sum == X:
return i
return -1
def solution(X, A):
check = set()
for i, a in enumerate(A):
check.add(a)
if len(check) == X:
return i
return -1