class Solution { public int findMin(int[] nums) { if(nums==null||nums.length==0){ return -1; } int start=0; int end=nums.length-1; while(start<=end){ int mid=start+(end-start)/2; if(nums[start]<=nums[end]){ return nums[start]; } if(nums[mid]<=nums[end]){ end=mid; }else{ start=mid+1; } } return -1; } }