Java 7 lines solution


  • 1
    Y
        public int findMin(int[] nums) {
            int l = 0, h = nums.length - 1, last = nums[h]; 
            while (l < h) {
                int mid = (l + h) >>> 1;
                if (nums[mid] > last) l = mid + 1;
                else h = mid;
            }   
            return nums[l];
        }
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.