The Runtime Theory
mediumLeetCode#binary-search#rotation

Find Minimum in Rotated Sorted Array

Find the minimum value in a strictly increasing array rotated between zero and n-1 positions.

The Runtime Theory Team25 min read
Solve it

Solving happens on the judge — come back and mark it done

Sample cases

innums=[3,4,5,1,2]

out1

innums=[4,5,6,7,0,1,2]

out0

innums=[11,13,15,17]

out11

Find the minimum value in a strictly increasing array rotated between zero and n-1 positions.

A good solution should

  • State the invariant or decision rule that makes the approach correct.
  • Explain the time and space complexity in terms of the input sizes and required output.
  • Handle empty, minimal, duplicate, and boundary-shaped inputs covered by the contract.

Reasoning prompt

Compare the midpoint with a known endpoint to decide which region contains the pivot. Cover the unrotated case.

Use the linked judge for the canonical problem. The examples above are compact TRT checks; write additional cases before submitting, especially for the boundary that tends to break your chosen invariant.

More practice in this topic

One dispatch a week

The trace behind each problem, the tradeoff that explains it, and one technical dispatch per week — no noise.

One technical dispatch per week. No noise.

Not started

Sign in to save your learning progress.

Sign in to save