Create a function to rotate elements in an array to the right by k positions.
MediumProblem Statement
Create a function to rotate elements in an array to the right by k positions.
Sample Input
array = [1, 2, 3, 4, 5], k = 2
Sample Output
[ 4, 5, 1, 2, 3 ]
Limits
Time: 2s · Memory: 256 MB