Rotate Array
Given an integer array
nums. Write a function void Rotate(int[] nums, int k) that rotates the array to the right by k steps.Example 1
Input: nums = [1, 2, 3, 4], k = 1
Output: [4, 1, 2, 3]
Explanation: Rotate the array by 1 step
Output: [4, 1, 2, 3]
Explanation: Rotate the array by 1 step
Example 2
Input: nums = [1, 2, 3, 4, 5], k = 2
Output: [3, 4, 5, 1, 2]
Explanation: Rotate the array to the right by 2 steps
Output: [3, 4, 5, 1, 2]
Explanation: Rotate the array to the right by 2 steps
Line 1, Char 1