Simple JAVA Solution


  • 0

    ...

    public int findMin(int[] nums) {
        int low = 0, high = nums.length - 1;
        while (low < high) {
            int mid = (low+high) >>> 1;
            
            if (nums[mid] < nums[high]) {
                high = mid;
            } else {
                low = mid+1;
            }
        }
        
        return nums[high];
    }
    

    ...


Log in to reply
 

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