📅  最后修改于: 2022-03-11 14:52:08.813000             🧑  作者: Mango
// https://leetcode.com/problems/find-minimum-in-rotated-sorted-array
// assuming Array has no duplicates
class Solution {
public int findMin(int[] nums) {
int start = 0;
int end = nums.length-1;
while (start < end){
int mid = start + (end-start)/2;
if (nums[mid] > nums[end]) start = mid+1;
if (nums[mid] < nums[end]) end = mid;
}
return nums[start];
}
}