static int findMissingNumber(int start, int end, List<Integer> list) { Collections.sort(list); int pre = start - 1; for (int n : list){ if ((n-pre)!=1){ return n-1; } pre = n; } return 0;}
Sign in to make a reply
CSU孔文佳