Hi:

This is my accepted solution, which uses binary search. O(logN).

```
public int findMin(int[] num) {
int low = 0;
int high = num.length - 1;
if (num[low] < num[high]) { // Not rotated
return num[low];
}
while (true) {
if (high == low) { // Cases like [1]
return num[low];
} else if (high - 1 == low) {
return Math.min(num[high], num[low]);
}
int mid = (low + high) / 2;
if (num[low] > num[mid]) {
high = mid;
} else {
low = mid;
}
}
}
```

Reason why it works:

Since we are looking for the smallest, when we see the arr[0] > arr[mid], then the pivot must be somewhere between these two elements. Otherwise it's in the other half. Apply this recursively and we will get the solution. Although it's accepted, I am still not 100% clear about the edge cases, so please correct me if any part of this code is unnecessary. Thanks!