Suppose a sorted ascending array of unique integers was rotated some number of times. Given the rotated array nums, return the minimum element in O(log n).
nums
O(log n)
Example
nums = [3, 4, 5, 1, 2] => 1 nums = [4, 5, 6, 7, 0, 1, 2] => 0
function FindMin(nums: int[]) -> int
Found a bug? Or annoyed about something in the language? Tell us.