728x90
반응형
Python
# you can write to stdout for debugging purposes, e.g.
# print("this is a debug message")
def solution(X, A):
# write your code in Python 3.6
position = set()
for i, a in enumerate(A):
if a <= X:
position.add(a)
if len(position) >= X:
return i
return -1
728x90
반응형
'Codility > Easy' 카테고리의 다른 글
PermCheck (0) | 2022.05.15 |
---|---|
TapeEquilibrium (0) | 2022.05.13 |
PermMissingElem (0) | 2022.05.12 |
FrogJmp (0) | 2022.05.11 |
OddOccurrencesInArray (0) | 2022.05.10 |