Loading...
Loading...
Loading...
Orders are numbered 1 to N. The warehouse received some of the numbers (a number may be received twice). Find the numbers that never arrived.
NONE if no number is missing.Example
Input
8 6 3 1 7 3 5 8
Output
2 4 6
2, 4 and 6 never arrived.
Try the problem first. Open one hint at a time.
Put the received numbers in a HashSet<Integer>.
Loop i from 1 to N and collect the numbers the set does not contain.
Write your Java code, run it on the examples and submit it to hidden tests.
Solve in the editor