#C3611. Unique Number Finder
Unique Number Finder
Unique Number Finder
You are given a sequence of integers in which every number appears exactly twice, except for one number which appears only once. Your task is to identify and print that unique number.
Hint: You may solve this problem efficiently using the bitwise XOR operation, which has the property that a XOR a = 0 and a XOR 0 = a.
The input will provide multiple test cases. For each test case, the first number indicates the length of the sequence, followed by the sequence of integers. For each test case, output the unique number on a new line.
Example:
Input: 3 5 4 1 2 1 2 7 5 3 4 3 5 4 6 3 1 1 2</p>Output: 4 6 2
inputFormat
The first line of input contains an integer T, the number of test cases. Each test case is described in one line. For each test case, the line begins with an integer N, the number of elements in the sequence, followed by N space-separated integers. It is guaranteed that for each test case, exactly one number occurs only once, while all others occur exactly twice.
outputFormat
For each test case, output a single line containing the unique number that appears exactly once in the sequence.
## sample3
5 4 1 2 1 2
7 5 3 4 3 5 4 6
3 1 1 2
4
6
2
</p>