标签:
FrogRiverOne
def solution(X, A): positions = set() for i in range(len(A)): if A[i] not in positions: positions.add(A[i]) if len(positions) == X: return i return -1
[codility] Lesson 2
原文地址:http://www.cnblogs.com/t--c---/p/4762243.html