• + 4 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(' '));
    }