#K84457. Find the Odd Occurring Integer

    ID: 36423 Type: Default 1000ms 256MiB

Find the Odd Occurring Integer

Find the Odd Occurring Integer

You are given an array of positive integers in which every element appears an even number of times except for one element that appears an odd number of times. Your task is to find and print the integer that appears an odd number of times.

The key insight behind the solution is to use the XOR (\(\oplus\)) operation. Recall that for any integer \(a\), it holds that \(a \oplus a = 0\) and \(a \oplus 0 = a\). Thus, when you XOR all the numbers together, the even-occurring numbers cancel out, leaving the odd-occurring number as the result.

Example:

Input:
7
1 2 3 2 3 1 3

Output: 3

</p>

inputFormat

The input is read from standard input (stdin). The first line contains an integer N representing the number of integers in the array. The second line contains N space-separated positive integers.

outputFormat

Print the integer that appears an odd number of times to standard output (stdout).

## sample
7
1 2 3 2 3 1 3
3