• + 0 comments

    def reverse(a,l,r): i=l j=r while i

    def circularArrayRotation(a, k, queries): k=k%len(a) reverse(a,0,len(a)-1) reverse(a,0,k-1) reverse(a,k,len(a)-1) l=[] for i in queries: l.append(a[i]) return l