export function shift(arr, n) {
  for (let i = 0; i < n; i++) {
    var popped = arr.pop();
    arr.splice(0, 0, popped);
  }
  return arr;
}

export function shiftRight(arr, n) {
  for (let i = 0; i < n; i++) {
    var shifted = arr.shift();
    arr.splice(arr.length - 1, 0, shifted);
  }
  return arr;
}

export function rotateArrays(...arrs) {
  let res = [];
  for (let i = 0; i < arrs[0].length; i++) {
    let boundaries = [];
    for (let arr of arrs) {
      boundaries.push(arr[i]);
    }
    res.push(boundaries);
  }
  return res;
}
