You are viewing a single comment's thread. Return to all comments →
Very similar to my code. I took the modulus of d but it isn't really necessary because the slice method does it automatically.
n, d = map(int, input().strip().split())
arr = list(map(int, input().strip().split()))
d %= n
print(*(arr[d:] + arr[:d]))