```
int findMin(int* nums, int numsSize) {
if(numsSize<=0)
return 0;
int min=nums[numsSize-1];
int i=0,j=numsSize-1;
while(i<=j){
int t=i+(j-i)/2;
if(nums[t]>min)
i=t+1;
else{
j=t-1;
min=nums[t];
}
}
return min;
}
```