Find Minimum in Rotated Sorted Array

Medium
ArrayBinary SearchAmazonMicrosoft
An ascending array of distinct integers was rotated at an unknown pivot. Print the minimum value in the array. Input format: - First line: n - Second line: n integers, the rotated array

Constraints

1 <= n <= 10^5
-10^9 <= nums[i] <= 10^9
Values are distinct and form a rotation of an ascending array.

Sample tests

Sample 1

Sample 2

Sign in to submit