#C1367. Single Number Finder

    ID: 43233 Type: Default 1000ms 256MiB

Single Number Finder

Single Number Finder

Given an array of integers in which every element appears twice except for one element that appears only once, your task is to find the unique element.

You can solve this problem using the bitwise XOR operator. Recall the property: \(a \oplus a = 0\) and \(0 \oplus b = b\). Hence, if you XOR all the elements together, the paired numbers cancel each other out, leaving only the unique element.

inputFormat

The input is given via standard input (stdin). The first line contains an integer \(n\), denoting the number of elements in the array. The second line contains \(n\) space-separated integers.

outputFormat

Output to standard output (stdout) a single integer — the element that appears only once in the array.

## sample
5
4 1 2 1 2
4