Find Minimum In Rotated Sorted Array
A strictly increasing array was rotated at an unknown boundary, possibly zero times. Return its smallest value in logarithmic time.
Example 1
nums = [7,9,1,3,5]1Explanation
The rotation boundary is between 9 and 1, so 1 is the minimum.
Example 2
nums = [1,3,8]1Explanation
The array is already sorted, so its first value is smallest.
Example 3
nums = [4]4Explanation
A singleton's only value is its minimum.
Constraints
- 1 <= len(nums) <= 5000
- All values are distinct
Function contract
findMinArguments: jsonSolutionRuns on your device
Loading draft…
Run: 3 examples; Submit: 35 cases, on your device.
[7,9,1,3,5]