#C9386. Single Non Duplicate
Single Non Duplicate
Single Non Duplicate
You are given an array of integers in which every element appears exactly twice except for one element that appears only once. Your task is to find and print this unique element.
This problem can be efficiently solved using the bitwise XOR operator. Recall that for any integer \(a\), we have \(a \oplus a = 0\) and \(0 \oplus a = a\). Thus, by XORing all the elements of the array, the duplicate elements cancel out, leaving only the unique element.
Note: The input will be provided via standard input (stdin) and the output should be printed to standard output (stdout).
inputFormat
The first line contains an integer \(n\) (the number of elements in the array). The second line contains \(n\) space-separated integers representing the array.
outputFormat
Print the unique element that appears only once.
## sample5
2 3 5 5 3
2