Your question is Array Rotation. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
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):