반응형
# you can write to stdout for debugging purposes, e.g.
# print("this is a debug message")
def solution(A, K):
# write your code in Python 3.6
# step 1 - take input A,K
# already succeed
# step 2 - create new array
arr_ = list(range(len(A)))
# step 3 - take iteration to solve the prob
for i in range(len(A)):
arr_[(i+K)%len(A)] = A[i]
return arr_
pass
반응형
'Codility' 카테고리의 다른 글
Codility - TapeEquilibrium (0) | 2020.04.13 |
---|---|
Codility - PermMissingElem (0) | 2020.04.12 |
Codility - FrogJmp (0) | 2020.04.11 |
Codility - OddOccurrencesInArray (0) | 2020.04.10 |
Codility - Binary Gap (0) | 2020.04.08 |