Minimum in rotated array
Your task
An ascending array of distinct integers was rotated at an unknown pivot. Given the rotated array nums, return its minimum element in O(log n) time. Array length up to 5000; the array may not be rotated at all.
Examples
find_min_rotated(nums: list[int]) -> intExample 1
Input
find_min_rotated([3, 4, 5, 1, 2])Output
1