Discuss / Java / 加强版练习

加强版练习

Topic source
static int findMissingNumber(int start, int end, List<Integer> list) {
    List<Integer> tmpList=new ArrayList<>(list.size()+1);  
    for (int i=start;i<=end;i++){
        tmpList.add(i);   
    }
    for (Integer i:list){
        tmpList.remove(i);   
    }
    return tmpList.get(0);
}

  • 1

Reply