Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- shiftRight([9, 7, 5, 3]) → [3, 9, 7, 5]
- shiftRight([7, 5, 3]) → [3, 7, 5]
- shiftRight([1, 2]) → [2, 1]
- shiftRight([1]) → [1]*/
- /*int* right_shift (int *arr, int len) {
- int *out = new int[len];
- for (int i = len - 1; i >= 1; i --)
- out[i] = arr[i - 1];
- out[0] = arr[len - 1];
- return out;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement