#C3082. Find the Unique Number That Appears Once
Find the Unique Number That Appears Once
Find the Unique Number That Appears Once
You are given an array of n integers in which every element appears exactly three times, except for one element which appears only once. Your task is to find and output this unique element.
The result should be computed using bitwise operations. For each bit position i (from 0 to 31), sum the contributions from each number. If the sum at that bit position is not a multiple of 3, then the unique number has a 1 in that bit. Note that if the computed number is at least $2^{31}$, then its actual value is the computed number minus $2^{32}$ (to account for negative numbers in 32-bit representation).
inputFormat
The first line contains an integer n, representing the number of elements in the array.
The second line contains n space-separated integers.
It is guaranteed that every element appears exactly three times except one element which appears only once.
outputFormat
Output a single integer — the unique number that appears exactly once.
## sample4
2 2 3 2
3