A Hexaware Technologies client-processing service stores pending work items in an ordered array. Implement a function that rotates nums to the right by k positions, modifying the same array and returning it.
A right rotation moves each element k positions later in the array. Elements that move beyond the last index wrap to the front. Because k may exceed the array length, normalize it before rotating.
nums, a list of integers, and k, a non-negative integer.nums after it has been rotated right by k positions.nums in place and use O(1) auxiliary space.def rotate_right(nums, k):