Sign In
You are coding as a Guest. Sign in with your RoleNest account to permanently track your streak, earn XP, and climb the Campus Leaderboard!
Sign In with RoleNest
🔥Find Minimum in Rotated Sorted ArrayMedium
MediumBinary Search•Acceptance: 50.1%

Find Minimum in Rotated Sorted Array

Real-World Engineering Context
Locating clock-skew synchronization offsets in distributed consensus nodes (Raft / Paxos) across UTC boundaries.
Suppose an array of length `n` sorted in ascending order is rotated between 1 and `n` times. Given the sorted rotated array `nums` of unique elements, return the minimum element of this array in O(log n) time.

Sample Test Cases

Input: [[3,4,5,1,2]]
Expected: 1
Input: [[4,5,6,7,0,1,2]]
Expected: 0
Input: [[11,13,15,17]]
Expected: 11

Constraints

  • n == nums.length
  • 1 <= n <= 5000
  • -5000 <= nums[i] <= 5000
  • All integers of nums are unique.