#K14416. Find the Unique Number
Find the Unique Number
Find the Unique Number
You are given an array of integers in which every element appears exactly twice except for one element which appears only once. Your task is to find and output this single unique number.
The solution must read input from stdin and write the result to stdout.
Note: If the array is empty, output 0.
Example:
Input: 7 2 3 5 4 5 3 4</p>Output: 2
inputFormat
The first line of input contains an integer n
, the number of elements in the array. The second line contains n
space-separated integers representing the array elements.
If n
is 0, the array is considered empty.
outputFormat
Output a single integer which is the element that appears only once in the array.
## sample7
2 3 5 4 5 3 4
2