You are viewing a single comment's thread. Return to all comments →
public static List<Integer> missingNumbers(List<Integer> arr, List<Integer> brr) { Collections.sort(brr); for(int i = 0; i < arr.size(); i++) { brr.remove(arr.get(i)); } // delete duplicates for(int i = 0; i < brr.size() - 1; i++) { int current = brr.get(i); int next = brr.get(i + 1); if(current == next) { brr.remove(i); } } return brr; }
Missing Numbers
You are viewing a single comment's thread. Return to all comments →