A Williams AV device maintains an ordered array of signal identifiers. Given an integer array nums and a nonnegative integer n, rotate the array clockwise by n positions and return the same array after modification.
A clockwise rotation moves the last element to the first position. The operation must be performed in place, without creating another array proportional to the input size.
nums, a mutable list of integers, and n, a nonnegative integer.nums, modified in place.n positions should produce the same result as repeatedly moving the final element to the front n times.def rotate_array(nums, n):