classSolution{publicintminArray(int[] numbers){int position =0;for(int i =0; i < numbers.length -1; i++){if(numbers[i +1]< numbers[i]){
position = i +1;}}return numbers[position];}}
4.题解代码
classSolution{publicintminArray(int[] numbers){int i =0, j = numbers.length -1;while(i < j){int m =(i + j)/2;if(numbers[m]> numbers[j]) i = m +1;elseif(numbers[m]< numbers[j]) j = m;else j--;}return numbers[i];}}