You are viewing a single comment's thread. Return to all comments →
Finally got it to be performant enough to pass by coming up with a for loop less solution.
let arrLength = line1[0], rotations = line1[1] % arrLength, arr = input[1].split(' '); console.log(arr.splice(rotations).concat(arr.splice(0,rotations)).join(' '));
Seems like cookies are disabled on this browser, please enable them to open this website
Left Rotation
You are viewing a single comment's thread. Return to all comments →
Finally got it to be performant enough to pass by coming up with a for loop less solution.