Suppose an array of length n sorted in ascending order is rotated between 1 and n times.
Given the rotated sorted array nums, return the minimum element of this array.
You must write an algorithm that runs in O(log n) time.
Input: [3,4,5,1,2] Output: 1
Input: [4,5,6,7,0,1,2] Output: 0
Input: [11,13,15,17] Output: 11
Print only the minimum value so it can be compared with expected output.
No submissions yet.
Discuss binary search logic, pivot detection, and edge cases with no rotation.