```
public int findMin(int[] num) {
int i = 0;
int j = num.length - 1;
int res = 0;
while (j >= i) {
if (num[i] <= num[j]) {
res = num[i];
break;
}
int m = i + (j - i) / 2;
if (num[i] <= num[m]) {
i = m + 1;
}
else {
j = m;
}
}
return res;
}
```

Just use binary search. When found the subarray is from low to high, simply return the first value.

If the length of the array is 0, the return value is 0 or we can set any value we want to res.