private double getMinCost(double[][] cost) {
OptionalDouble optionalDouble = Arrays.stream(cost).flatMapToDouble(Arrays::stream).min();
if (optionalDouble.isPresent()) {
return optionalDouble.getAsDouble();
}
return MAX_DOUBLE;
}
二维数组取最大最小值-结合贪心算法
最新推荐文章于 2023-11-10 20:02:54 发布