Given the sorted rotated array nums that may contain duplicates, return the minimum element of this array. You must decrease the overall operation steps as much as possible.
Example 1
Input: nums = [4,5,5,5,1,2,2,3,3,4,4]
Output: 1
Explanation: Duplicates make the halves harder to tell apart, but the only drop is from 5 to 1, so the minimum is 1.
Example 2
Input: nums = [1,3,5]
Output: 1
Explanation: The array is already in sorted order (it was rotated a full cycle), so the first element, 1, is the minimum.
Example 3
Input: nums = [2,2,2,0,1]
Output: 0
Explanation: The value drops from 2 to 0 after the run of 2s, so the minimum is 0.
Like the no-duplicates version, compare mid with hi. When they're equal, we can't decide which half, so shrink hi by 1. This degrades to O(n) worst case but handles duplicates.
Run checks all cases above. Submit evaluates all test cases.