题解 | #旋转数组的最小数字# 纯小白 硬解
旋转数组的最小数字
https://www.nowcoder.com/practice/9f3231a991af4f55b95579b44b7a01ba
import java.util.List; import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; public class Solution { public int minNumberInRotateArray(int [] array) { if (array.length <= 1) { return array[0]; } List<Integer> list = new ArrayList<>(); for (int i = 0; i < array.length; i++) { list.add(array[i]); } list.sort(Comparator.comparing(Integer::intValue)); return list.get(0); } }#剑指offr#