• + 0 comments

    JavaScript solution in 0(n) time 0(1) space without copying or modifying the given array.

    function circularArrayRotation(a, k, queries) { return queries.map(q => a.at((q - k) % a.length)) }