Zensar Technologies may need to reorder sequential data without allocating another full array. Given an integer array, perform its kth rotation, defined here as a left rotation by k positions.
Implement kth_rotation(nums, k) so that the input array is modified in place and returned.
nums, a mutable list of integers, and k, a non-negative integer.k positions.k is greater than the array length, treat it modulo the array length.def kth_rotation(nums, k):