Advertisement
Spocoman

04. Array Rotation

Jan 22nd, 2022
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function solve(arr, num) {
  2.  
  3.     for (let i = 0; i < num; i ++) {
  4.         arr.push(arr.shift());
  5.     }
  6.     console.log(arr.join(" "));
  7. }
  8.  
  9.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement