#C14049. Unique Numbers Extraction
Unique Numbers Extraction
Unique Numbers Extraction
You are given a list of integers. Your task is to extract all the numbers that appear exactly once and output them in ascending order.
In mathematical terms, given an array \( A = [a_1, a_2, \dots, a_n] \), find all \( x \) such that the frequency \( f(x)=1 \), and then output the sorted list \( \{ x \mid f(x)=1\} \).
If no such numbers exist, output an empty line.
Example:
Input: 9 4 5 7 5 8 9 7 4 10</p>Output: 8 9 10
inputFormat
The input is given via standard input.
The first line contains an integer \(N\) representing the number of elements in the list. The second line contains \(N\) space-separated integers.
Note: If \(N = 0\), the second line might be empty.
outputFormat
Output the unique numbers (those that appear exactly once) in ascending order on a single line, separated by a space. If there are no unique numbers, output an empty line.
## sample9
4 5 7 5 8 9 7 4 10
8 9 10