def solution(A, K):
if len(A) == K or len(A) == 0:
return A
elif len(A) < K:
K = K % len(A)
for i in range(K):
item = A.pop()
A.insert(0, item)
return A
def solution(A, K):
if len(A) == K or len(A) == 0:
return A
elif len(A) < K:
K = K % len(A)
for i in range(K):
item = A.pop()
A.insert(0, item)
return A