https://app.codility.com/programmers/lessons/3-time_complexity/
정답률: 100%
시간 복잡도: O(N) or O(N * log(N))
def solution(A):
N = len(A)
total = int((N+1)*(N+2)/2)
answer = total - sum(A)
return answer
728x90
반응형
'Problem Solving > Codility' 카테고리의 다른 글
[Python] 4.1. FrogRiverOne (0) | 2021.03.13 |
---|---|
[Python] 3.3. TapeEquilibrium (0) | 2021.03.11 |
[Python] 3.1. FrogJmp (0) | 2021.03.07 |
[Python] 2.2. OddOccurrencesInArray (0) | 2021.03.07 |
[Python] 2.1. CyclicRotation (0) | 2021.03.06 |
댓글