Quant Memo
Coding/●●●●●

Find the minimum in a rotated sorted array

A sorted array of distinct integers was rotated at an unknown pivot, like a log of prices whose oldest entry is no longer at the front.

a = [4, 5, 6, 7, 0, 1, 2]  -> 0
a = [3, 4, 5, 1, 2]        -> 1
a = [1, 2, 3]              -> 1   (no rotation)

Return the minimum value. Aim for O(logn)O(\log n).

Your answer

This one is open-ended. Work it through, then check your reasoning against the full solution.

More Coding questions