• + 0 comments

    JS Solution

    let n = Math.ceil(d / arr.length) + 1;
    let tempArray = Array(n).fill(arr).flat();
    for (let index = 0; index < arr.length; index++) {
    	arr[index] = tempArray[index + d];
    }
    return arr;
    }