• + 1 comment
    `function circularArrayRotation(a, k, queries) {
        let n = a.length; 
        k = k % n; 
        
        let res = []; 
        
        for(let q of queries) {
            res.push( a[ (q - k + n) % n]); 
        }
        
        return res;
    }
    

    `