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); }
Sign in to make a reply
树叶咖啡厅