static int findMissingNumber(int start, int end, List<Integer> list) {
int count = 0;
Integer[] array = list.toArray(Integer[]::new);
for (int i = start; i <= end; i++) {
for (int s : array) {
if (s == i) {
count = 0;
break;
} else if (s != i && count!=list.size()-1) {
count++;
continue;
} else if (s != i && count==list.size()-1){
return i;
}
return 0;
Sign in to make a reply
I WILL.
static int findMissingNumber(int start, int end, List<Integer> list) {
int count = 0;
Integer[] array = list.toArray(Integer[]::new);
for (int i = start; i <= end; i++) {
for (int s : array) {
if (s == i) {
count = 0;
break;
} else if (s != i && count!=list.size()-1) {
count++;
continue;
} else if (s != i && count==list.size()-1){
return i;
}
}
}
return 0;
}