Your question is Rotate Prime Numbers by Input. 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.
PCS Global Tech processes ordered prime-number sequences. Given an array nums containing prime numbers and a non-negative rotation count k, rotate the array to the right by k positions and return the modified array.
The rotation must be performed in place, without creating another array proportional to nums.length. The values are guaranteed to be prime, so do not validate primality.
Implement rotate_primes(nums, k):
nums, a mutable list of distinct or repeated positive prime integers, and k, a non-negative integer.k positions.0 and shifts every other element one position right.k exceeds the array length, equivalent rotations should be used.def rotate_primes(nums, k):