You are given an array nums consisting of distinct positive integers.
In one right shift operation, the last element of nums is moved to the first position, and all other elements are shifted one position to the right.
Return the minimum number of right shifts needed to sort nums in strictly increasing order. If it is impossible to sort the array using right shifts, return
Constraints:
nums.length
nums[i]
nums contains distinct integers.
You are given an array nums consisting of distinct positive integers.
In one right shift operation, the last element of nums is moved to the first position, and all other elements are shifted one position to the right.
Return the minimum number of right shifts needed to sort nums in strictly increasing order. If it is impossible to sort the array using right shifts, return
Constraints:
nums.length
nums[i]
nums contains distinct integers.