#C5713. Finding Unique Numbers
Finding Unique Numbers
Finding Unique Numbers
You are given a list of integers in which every number appears exactly twice except for either one or two numbers that appear only once. Your task is to identify the unique number(s). If there is a single unique number, output that number. If there are two unique numbers, output them in increasing order separated by a space.
The problem can be mathematically interpreted as follows: Let \( A = [a_1, a_2, \dots, a_n] \) be a list where each element appears exactly twice except one or two numbers. Find \( x \) if there is one unique element, or \( (y, z) \) with \( y < z \) if there are two unique elements.
If the input does not meet the constraints (i.e. there are no unique elements or more than two unique elements), output the error message:
The input list does not comply with the problem constraints.
inputFormat
The first line contains an integer \( n \) which denotes the number of integers in the list. The second line contains \( n \) space-separated integers.
outputFormat
If the list contains one unique number, print that number. If it contains two unique numbers, print them in increasing order separated by a space. In case the constraints are not met, print "The input list does not comply with the problem constraints."
## sample7
2 3 2 4 4 5 3
5