You are given an array nums and a non-negative number k. Move the array to the right by k steps. In one step the last element goes to the front and all other elements move one place to the right.
Examples
Example 1:
Input: nums = [10,20,30,40,50], k = 2
Output: [40,50,10,20,30]
Explanation: After 1 step: [50,10,20,30,40]. After 2 steps: [40,50,10,20,30].
Example 2:
Input: nums = [7,8,9], k = 4
Output: [9,7,8]
Explanation: After 3 steps the array is back to the start, so 4 steps is the same as 1 step.
Example 3:
Input: nums = [5,1], k = 0
Output: [5,1]
Explanation: Zero steps change nothing.