516. Rotate Array by K times
0
Medium
Satyam and Ayushi are two friends who are studying at Coding Blocks. They are stuck on a coding problem,So they need your help. You have to solve the problem.
You are given an array of size **N**, rotate the array to the right by **k** steps,
where k is non-negative integer.
Input Format
First Line contains two-space separated integers N and K .
Second line consisting of an Integer array.
Second line consisting of an Integer array.
Output Format
Print Rotated Array
Example
Input
5 2
1 2 3 4 5
Output
4 5 1 2 3
Constraints
1 < = N <= 105
0 < = K <= 105
-231 <= Arr[i] <= 231
Loading...
View Submissions
Console