Description
Given a rotated sorted array with possible duplicates, find the minimum element. The array was originally sorted in ascending order.
Examples
Input:
nums = [2,2,2,0,1]Output:
0Explanation:
Min is 0.
Input:
nums = [4,5,6,7,0,1,1,4]Output:
0Explanation:
The rotated sorted array with duplicates has minimum element 0.
Input:
nums = [3,3,3,3]Output:
3Explanation:
All elements are identical, so the minimum is that repeated value.
Constraints
- •
1 ≤ nums.length ≤ 5000