Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let input = ['5,3,2,1', 2];
- let gets = this.gets || ((arr, index) => () => arr[index++])(input, 0);
- let list = gets().split(',');
- let n = +gets();
- let result = [];
- let rotatedEl;
- for(let i = 0; i < n; i++){
- let removedElement = list.shift();
- removedElement == 1;
- rotatedEl = list.push(removedElement);
- }
- console.log(list.join(','))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement