For an array nums of length n and a non-negative integer t with 0 ≤ t < n, a cyclic t-shift of nums is the array obtained by taking the last t elements of nums and moving them, in order, to the front. Concretely:
t = 0leaves the array unchanged:[nums[0], nums[1], ..., nums[n-1]].t = 1produces[nums[n-1], nums[0], nums[1], ..., nums[n-2]].t = 2produces[nums[n-2], nums[n-1], nums[0], nums[1], ..., nums[n-3]].t = n-1produces[nums[1], nums[2], ..., nums[n-1], nums[0]].
Ask AI Assistant

Ask AI Assistant
Ask me anything about this coding question!
Test Cases
Input
Output
Expected