def aa(nums): if not nums: return False left,right=0,len(nums)-1 while nums[left]>=nums[right]: if right-left==1: return nums[right] mid=int((left+right)/2) if nums[left]==nums[mid]==nums[right]: return min(nums) if nums[left]>nums[mid]: right=mid if nums[right]<nums[mid]: left=mid return nums[right] print(aa([4,5,1,2,3]))