Write a program to rotate an array n times to the right.
MediumProblem Statement
Write a program to rotate an array n times to the right.
Sample Input
[1, 2, 3, 4, 5], 2
Sample Output
[4, 5, 1, 2, 3]
Limits
Time: 2s · Memory: 256 MB
Write a program to rotate an array n times to the right.
[1, 2, 3, 4, 5], 2
[4, 5, 1, 2, 3]
Time: 2s · Memory: 256 MB