📅  最后修改于: 2022-03-11 15:01:49.731000             🧑  作者: Mango
// circular array rotation hackerrank solution in javascript
function circularArrayRotation(a, k, queries) {
// Write your code here
for(let i = 0; i < k; i++) {
a.unshift(a.pop());
}
let arr = [];
for(let j = 0; j < queries.length; j++) {
arr.push(a[queries[j]]);
}
return arr;
}