You are viewing a single comment's thread. Return to all comments →
Java Solution
public static List<Integer> missingNumbers(List<Integer> arr, List<Integer> brr) { List<Integer> arrCopy = new ArrayList<>(arr); Set<Integer> missing = new TreeSet<>(); for (Integer b: brr) { if (!arrCopy.contains(b)) { missing.add(b); } else { arrCopy.remove(b); } } return missing.stream().collect(Collectors.toList()); }
Seems like cookies are disabled on this browser, please enable them to open this website
Missing Numbers
You are viewing a single comment's thread. Return to all comments →
Java Solution