← All problems
Find Minimum in Rotated Sorted Array
Find the minimum element in a rotated sorted array in O(log n) time. Think about which half of the array must contain the minimum at each step.
Complexity
Time O(log n), Space O(1)
Common pitfalls
- Comparing with nums[lo] instead (ambiguous)
- Missing the duplicate case
Your solution
Log in to save your code and track progress.