You are viewing a single comment's thread. Return to all comments →
This works in Javascript for all test cases:
function main() { var n_temp = readLine().split(' '); var n = parseInt(n_temp[0]); var k = parseInt(n_temp[1]); var q = parseInt(n_temp[2]); a = readLine().split(' '); a = a.map(Number); for (var i=0; i<q; i++) { var m = readLine(); console.log(a.slice(m-k%n)[0]); } }
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 →
This works in Javascript for all test cases: