#C12789. Find Missing Numbers
Find Missing Numbers
Find Missing Numbers
You are given an integer n and an unsorted array of integers. Your task is to find all the integers that are missing in the range \(1 \leq x \leq n\) from the array. The missing numbers should be output in increasing order.
Example: For n = 10 and the array [3, 7, 1, 2, 8, 4, 5]
, the missing numbers are [6, 9, 10]
.
Note: The array might include numbers outside the range \(1\) to \(n\). Only consider numbers from 1 to n for finding out the missing ones.
inputFormat
The first line contains a single integer n, which is the maximum number to be considered. The second line contains zero or more space-separated integers representing the array elements. If there are no numbers on the second line, the array is considered empty.
outputFormat
Output a single line with the missing numbers in increasing order separated by a space. If there are no missing numbers, output an empty line.
## sample10
3 7 1 2 8 4 5
6 9 10