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]))
Seems like cookies are disabled on this browser, please enable them to open this website
Left Rotation
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.