ICode9

精准搜索请尝试: 精确搜索
  • 146. LRU 缓存2022-06-24 11:32:47

    class LRUCache { class DoubleList{ public int key, val; public DoubleList prev, next; public DoubleList(){} public DoubleList(int key, int val){ this.key = key; this.val = val; } }

  • 获取List中的最大、最小、平均值2021-05-19 11:02:41

    最大、最小值 Double max = doubleList.stream().max(Comparator.comparingDouble(Double::doubleValue)).orElse(null); Double min = doubleList.stream().min(Comparator.comparingDouble(Double::doubleValue)).orElse(null); Double max = doubleList.stream().mapToDoubl

  • 使用stream求数组中的平均值2020-11-09 20:31:53

    通过数组和流的转换来求平均值: public class DoubleStream { public static void main(String[] args) { List<Double> doubleList = new ArrayList<>(); doubleList.add(1.3); doubleList.add(2.2); doubleList.add(3.2); doubl

  • 去除重叠区间2020-10-21 16:00:37

    题目:去除区间中重叠的部分 intput1 :  [[1, 2], [1, 3], [2, 3], [3, 4]]output1:  [[1, 2], [2, 3], [3, 4]]input2:    [[1, 2], [1, 2], [1, 2]]output2:  [[1, 2]]input3:    [[1, 2], [2, 3]]output3:  [[1, 2], [2, 3]] 思路: 将区间进行排序,从小到大,获取第一个区间

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有