#K39332. Find Missing Badge IDs
Find Missing Badge IDs
Find Missing Badge IDs
You are given a total of ( n ) expected badge IDs numbered from 1 to ( n ) and a list of printed badge IDs (which may contain duplicates). Your task is to find all the missing badge IDs that are not printed. The missing IDs should be output in ascending order.
Note: The input is provided via standard input (stdin) and the output should be written to standard output (stdout). If all badge IDs are printed, output an empty line.
inputFormat
The input consists of two lines. The first line contains a single integer ( n ) (1 ( \leq n \leq 10^5 )), which represents the total number of expected badge IDs ( {1, 2, \dots, n} ). The second line contains a sequence of space-separated integers representing the printed badge IDs. This line may be empty if no badge IDs are printed.
outputFormat
Output the missing badge IDs in ascending order, separated by a single space. If no IDs are missing, output an empty line.## sample
5
2 3 2 5 3
1 4
</p>