Given a rotated sorted array of distinct integers nums, find the index of the pivot — the index of the largest element (where the rotation break occurs). If the array is not rotated, return the last index.
Input: A rotated sorted array of distinct integers.
Output: Index of the largest element (pivot).
Input: [4,5,6,7,0,1,2]
Output: 3
Explanation: The largest element is 7 at index 3. Rotation point is between index 3 and 4.Input: [3,4,5,1,2]
Output: 2
Explanation: Largest is 5 at index 2.Input: [1,2,3,4,5]
Output: 4
Explanation: Not rotated; largest is at last index 4.1 <= nums.length <= 5000All values distinct-5000 <= nums[i] <= 5000