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

@@ -1,15 +1,58 @@
-public 
+// Solution runs in O(log n) time and O(1) space.%0A
 class So
@@ -160,29 +160,22 @@
 int 
-low = 0;%0A    int high
+start = 0, end
  = n
@@ -205,83 +205,23 @@
 le (
-low %3C= high) %7B%0A      if (nums%5Blow%5D %3C= nums%5Bhigh%5D)%0A        return nums%5Blow%5D;
+start %3C= end) %7B
 %0A   
@@ -232,24 +232,23 @@
 nt m
-id
  = (
-low + high
+start + end
 ) / 
@@ -270,23 +270,20 @@
 ms%5Bm
-id%5D %3E=
+%5D %3C
  nums%5B
-low
+end
 %5D) %7B
@@ -295,21 +295,15 @@
     
-low
+end
  = m
-id + 1
 ;%0A  
@@ -327,18 +327,21 @@
     
-high = mid
+start = m + 1
 ;%0A  
@@ -372,11 +372,11 @@
 ums%5B
-low
+end
 %5D;%0A 

update solution