#C9042. Unique Number Finder

    ID: 53092 Type: Default 1000ms 256MiB

Unique Number Finder

Unique Number Finder

You are given multiple test cases. Each test case consists of a list of n integers where every integer appears exactly twice except for one unique number that appears only once. Your task is to find and print the unique number for each test case.

Using the properties of the bitwise XOR operation, recall that for any integers \(a\) and \(b\), the equation \(a \oplus a = 0\) holds and \(a \oplus 0 = a\). Therefore, the unique number can be obtained by XOR-ing all numbers in the list.

inputFormat

The input is given from the standard input and has the following format:

  • The first line contains an integer T denoting the number of test cases.
  • The following lines contain the test cases. For each test case:
    • The first line contains an integer n (\(n \geq 1\)).
    • The second line contains \(n\) space-separated integers.

outputFormat

For each test case, output a single line containing the unique number found in that test case. The output should be written to the standard output.

## sample
2
5
1 2 3 2 1
7
4 5 6 5 4 6 7
3

7

</p>