• + 0 comments

    My javascript solution

    function processData(input) {
        const oprCount = input.split('\n')[0].split(' ')[1];
        let arr = input.split('\n')[1].split(' ');
    
        arr.push(...arr.splice(0,oprCount));
    
        console.log(arr.join(' '));
    }