Simple Java Solution


  • 6
    D
    public int findMin(int[] nums) {
        
        	int start = 0, end = nums.length - 1, mid;
        	while (start  <  end) {
        		mid = (start + end) / 2;
        		if (nums[mid]  > nums[end])
        			start = mid + 1;
        		else
        			end = mid;
        	}
        	return nums[start];
    }

Log in to reply
 

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