#153

Find Minimum in Rotated Sorted Array

MediumBinary SearchHas vizArrayBinary Search
Related studio

Problem

Find Minimum in Rotated Sorted Array

You must solve the interview problem titled "Find Minimum in Rotated Sorted Array".

Difficulty: Medium. Topics: Array, Binary Search. Primary pattern: Binary Search.

Read the title as the specification: implement the exact behavior it names, return the correct output type, and aim for an interview-optimal Binary Search solution. Use the examples to lock input/output format, then confirm edge cases (empty, single element, duplicates, extremes).

Example 1

Input: sample input for Find Minimum in Rotated Sorted Array

Output: sample output for Find Minimum in Rotated Sorted Array

Apply a Binary Search approach and match the required return type.

Example 2

Input: edge-case input for Find Minimum in Rotated Sorted Array

Output: edge-case output for Find Minimum in Rotated Sorted Array

Verify empty/single/boundary behavior.

Constraints

  • Interview-scale limits for a Medium Binary Search problem.
  • Handle empty and single-element inputs when they are valid.
  • Prefer the optimal asymptotic complexity expected in interviews.
Loading visualization…

Explanation

Find Minimum in Rotated Sorted Array is a Medium interview problem tagged [Array, Binary Search]. The winning approach is typically **Binary Search**.

Intuition

Halving the space each step yields O(log n) probes on sorted or monotonic answer spaces.

Approach

Maintain a monotonic search interval. Probe mid and discard the half that cannot contain the answer.

  1. Write the lo/hi invariant in one sentence.
  2. Compute mid safely.
  3. Decide which half survives.
  4. Stop when interval collapses; map lo/hi to the answer form.

Solution

Pattern-level skeleton only — not this problem’s exact answer. Adapt it to the statement.

Pattern templateBinary Search

Edge cases

  • •Empty or single-element input
  • •Duplicates and ties
  • •Maximum constraints / overflow
  • •Disconnected or unreachable states (for graphs)

Complexity

Time: O(log n) or O(n log n)

Space: O(1)

Before coding, restate the problem, name the pattern (Binary Search), and write the invariant or DP state in one sentence.

Learn the topic

Got it?

Mark #153 Find Minimum in Rotated Sorted Array as understood when the pattern clicks.