low
as 0 and high
as len(nums) - 1
.low
is less than high
:
a. Calculate the midpoint pivot
as low + (high - low) // 2
.
b. If nums[pivot] < nums[high]
, set high
to pivot
.
c. If nums[pivot] > nums[high]
, set low
to pivot + 1
.
d. If nums[pivot] == nums[high]
, decrement high
by 1.nums[low]
as the minimum element.