The tiles of a prize wheel carry different numbers that were painted on in increasing order. Then the
wheel was turned k steps to the right; each step moves the last tile to the front. Given the tiles as
they read now, nums, return k, where 0 <= k < len(nums).
Examples
Input: nums = [4, 5, 1, 2, 3]
Output: 2
Explanation: [1, 2, 3, 4, 5] turned two steps to the right.
Input: nums = [1, 2, 3, 4, 5]
Output: 0
Input: nums = [5, 1, 2, 3, 4]
Output: 1
Constraints
1 <= len(nums) <= 10**6- All values are distinct.
O(log n)time is required.
Goals
- Compare against the last element to decide which half holds the minimum
- Handle the unrotated case