Problem · Array
Find Minimum in a Rotated Sorted Array
Learn this problemProblem statement
Return the minimum element of nums, which was formed by rotating a strictly increasing array.
Function
findMin(nums: int[]) → intExamples
Example 1
nums = [3,4,5,1,2]return = 1The rotation point begins at one.
Example 2
nums = [4,5,6,7,0,1,2]return = 0Zero is the first value after the pivot.
Constraints
1 <= nums.length <= 100000- All values are distinct.
- The required time complexity is
O(log n).