반응형
# you can write to stdout for debugging purposes, e.g.
# print("this is a debug message")

def solution(A):
    # write your code in Python 3.6
    
    # step 1 - sort the array by acsend way
    A = sorted(A)
    
    # step 2 - find the missing one in range 1 ~ len(A)+1
    for i in range(0,len(A)):
        if i+1 != A[i]:
            return i+1
            
    return len(A)+1
            
    pass

 

반응형

'Codility' 카테고리의 다른 글

Codility - FrogRiverOne  (0) 2020.04.13
Codility - TapeEquilibrium  (0) 2020.04.13
Codility - FrogJmp  (0) 2020.04.11
Codility - OddOccurrencesInArray  (0) 2020.04.10
Codility - CyclicRotation  (0) 2020.04.09

+ Recent posts