The algorithm: Initialize left = , right = n While left < right: - Compute mid - If nums[mid] > nums[right], the minimum is after mid - left = mid + - Else, the minimum is at mid or before - right = mid Return nums[left] Notice: we use left < right (not <=) and right = mid (not mid). This is a different binary search template for finding boundaries.
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
$ curl repovive.com/roadmaps/maang-interview-prep/binary-search/find-minimum-in-rotated-array-solution
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░██████████████████████████████████████████████████████████████████████████████████████████████████████