Advertisement
Abreu-Hoff

Untitled

May 24th, 2021
323
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1.  
  2.  shiftRight([9, 7, 5, 3])[3, 9, 7, 5]
  3.  shiftRight([7, 5, 3])[3, 7, 5]
  4.  shiftRight([1, 2])[2, 1]
  5.  shiftRight([1])[1]*/
  6.  
  7.  
  8. /*int* right_shift (int *arr, int len) {
  9.     int *out = new int[len];
  10.     for (int i = len - 1; i >= 1; i --)
  11.         out[i] = arr[i - 1];
  12.     out[0] = arr[len - 1];
  13.    
  14.     return out;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement