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 RoleNestProblem Set
🔥Find Minimum in Rotated Sorted ArrayMedium
DAILY PROBLEM OF THE DAY+50 XP • Daily Streak
Solve today's challenge or tackle one of the 3 Super Hard challenges for +150 XP.
MediumBinary Search•Acceptance: 50.1%
Find Minimum in Rotated Sorted Array
Targeted in FAANG & Tech OA:GoogleAmazonMicrosoft
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.
Recruiter Fast-Track ReferralVerified Candidate
Direct pipeline to Google, Amazon, Microsoft, Swiggy, & Uber recruiters
Top DevScore profiles bypass resume screening filters. Every verified problem solve writes authentic proof-of-work to your profile and dispatches you directly into employer inboxes on RoleNest.
Explore 5,000+ Direct ATS Openings on RoleNest ↗✓ Direct Referral Active
Language:
Ready to test. Click Run Code or Submit Solution to run test cases in isolated browser sandbox.