Your question is Clockwise 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.
Sam Houston State University systems may need to shift a sequence of records so the newest entries appear first. Given an integer array and a nonnegative rotation count, rotate the array clockwise, meaning to the right, by k positions.
Modify the input array in place and return it. Aim for linear time and constant extra space. Rotating by more than the array length should produce the same result as rotating by k % len(nums) positions.
Implement rotate_array(nums, k).
nums, a list of integers, and k, a nonnegative integer.k positions.def rotate_array(nums, k):