Right Rotation
Right Rotation easy Time Limit: 2 sec Memory Limit: 128000 kB
Last updated
Right Rotation easy Time Limit: 2 sec Memory Limit: 128000 kB
Last updated
Problem Statement:
Given an array a, you must perform one right rotation on an array of n integers. In one right rotation, all elements will move one index to the right in a circular motion. Print the array's n space-separated integers after the right rotation. Input The first line contains n. The next line contains n space-separated integers.
constraints 1 ≤ n ≤ 105 1 ≤ arr[i] ≤ 109 Output Print n space-separated integers of the array after the right rotation. Example Sample Input: 5 1 2 3 4 5
Sample Output: 5 1 2 3 4
link: