You are viewing a single comment's thread. Return to all comments →
Here is another Python Solution:-
n,k,q = input().strip().split(' ') n,k,q = [int(n),int(k),int(q)] a = [int(a_temp) for a_temp in input().strip().split(' ')]
for i in range(q): m = int(input().strip()) print(a[(m-k)%len(a)])
Seems like cookies are disabled on this browser, please enable them to open this website
Circular Array Rotation
You are viewing a single comment's thread. Return to all comments →
Here is another Python Solution:-
n,k,q = input().strip().split(' ') n,k,q = [int(n),int(k),int(q)] a = [int(a_temp) for a_temp in input().strip().split(' ')]
for i in range(q): m = int(input().strip()) print(a[(m-k)%len(a)])