I think it is confusing to someone like myself when I saw those posts comparing the nums[mid] with nums[r] instead of nums[mid] ? nums[l], since I did comparison between mid and left for most of the problems. So here is the traditional way:

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