#K12981. Find Unique Element
Find Unique Element
Find Unique Element
You are given an array of n integers where every element appears exactly twice except for one unique element which appears only once. Your task is to find and output this unique element.
The problem can be understood mathematically using the exclusive-or (XOR) operator. Recall that for any integers \(a\) and \(b\), the operation \(a \oplus b\) has the property that \(a \oplus a = 0\) and \(a \oplus 0 = a\). Hence, when you XOR all elements of the array, pairs of identical numbers cancel out, leaving only the unique element.
Input/Output Requirement: The input will be provided from standard input (stdin) and the output should be written to standard output (stdout).
inputFormat
The first line contains an integer \(n\) indicating the number of elements in the array. The second line contains \(n\) space-separated integers representing the elements of the array.
outputFormat
Output a single integer, which is the unique element in the array.
## sample5
2 3 1 2 3
1
</p>