DEV Community

ZeeshanAli-0704
ZeeshanAli-0704

Posted on

Left Rotation - HackerRank

Left Rotation:
function rotateLeft(d, arr) {

    for(let i=0; i < d; i++){
          arr.push(arr.shift());
    }
return arr;
}

Enter fullscreen mode Exit fullscreen mode

Top comments (0)