static int findMissingNumber(int start, int end, List<Integer> list) { for(Iterator<Integer> li = list.iterator(); li.hasNext();){ int num = li.next(); while(start <= end){ if(num == start) { num = li.next(); start++; continue; } else{ return start;} } } return 0; }
Sign in to make a reply
Carol-zyl