本题的关键是对于非降序数组的理解以及处理取值相等的情况
class Solution:
def minNumberInRotateArray(self , rotateArray: List[int]) -> int:
# write code here
array_len = len(rotateArray)
left = 0
right = array_len - 1
while left < right:
mid = int((left + right) / 2)
if rotateArray[mid] > rotateArray[right]:
left = mid + 1
elif rotateArray[mid] < rotateArray[right]:
right = mid
elif rotateArray[mid] == rotateArray[right]:
right -= 1
return rotateArray[right]