0%
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| class Solution: def findMin(self, nums: List[int]) -> int: left = 0 right = len(nums)-1 while left<right: mid = (left+right)>>1 if nums[mid]>nums[right]: left = mid+1 elif nums[mid]<nums[right]: right = mid else: right -= 1 return nums[left]
|