We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
defdynamicArray(n,q):# Write your code herel=0la=[]a=[]foriinrange(n):a.append(list())foriinrange(len(q)):ifq[i][0]==1:idx=((q[i][1]^l)%n)a[idx].append(q[i][2])ifq[i][0]==2:idx=((q[i][1]^l)%n)l=a[idx][q[i][2]%len(a[idx])]la.append(l)returnla
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Dynamic Array
You are viewing a single comment's thread. Return to all comments →