You are viewing a single comment's thread. Return to all comments →
No need of loops, here is my solution in js
function processData(input) { //Enter your code here let linesArray = input.split("\n"); let line1 = linesArray[0].split(' '); let numberOfInt = line1[0]; let numberOfRotations = line1[1]; let integers = linesArray[1].split(' '); array1 = integers.slice(0, numberOfRotations); array2 = integers.slice(numberOfRotations, numberOfInt); console.log(array2.concat(array1).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 →
No need of loops, here is my solution in js