Problem · Array

Find Minimum in a Rotated Sorted Array

Learn this problem
MediumPoint72 logoPoint72FULLTIMEPHONE SCREEN

Problem statement

Return the minimum element of nums, which was formed by rotating a strictly increasing array.

Function

findMin(nums: int[]) → int

Examples

Example 1

nums = [3,4,5,1,2]return = 1

The rotation point begins at one.

Example 2

nums = [4,5,6,7,0,1,2]return = 0

Zero is the first value after the pivot.

Constraints

  • 1 <= nums.length <= 100000
  • All values are distinct.
  • The required time complexity is O(log n).

More Point72 problems

drafts saved locally
public int findMin(int[] nums) {
  // Write your code here.
}
nums[3,4,5,1,2]
expected1
checking account