public class Solution {

```
int min;
public int findMin(int[] nums) {
min = nums[0];
search(nums,0,nums.length);
return min;
}
void search(int[] nums,int left,int right){
if (left >= right) return;
int mid = (left + right) /2;
if (min > nums[mid]) {
min = nums[mid];
search(nums,left,mid);
}
else search(nums,mid+1,right);
}
```

}