思路:
二分查找,查找数组元素值 <= 旋转数组中最后一个元素的组左边的为止的数,就是最小的元素
class Solution {
public int findMin(int[] nums) {
int l = 0 ; int r = nums.length -1;
int target = nums[r];
while(l < r){
int mid = l+r >>1;
if(nums[mid] <= target){
r = mid;
}else{
l = mid +1;
}
}
return nums[r];
}
}