Medium · Binary search
Find Minimum in Rotated Sorted Array
You are given a sorted list of distinct whole numbers that has been rotated: some front part was moved to the back. Return the smallest number in it.
- Every number appears once.
- The list has at least one number, and may not be rotated at all.
- Aim for O(log n): do not scan the whole list.
nums = [3, 4, 5, 1, 2] → 1Record your take