#K46012. Find the Unique Number

    ID: 27882 Type: Default 1000ms 256MiB

Find the Unique Number

Find the Unique Number

Given a list of integers where every element appears exactly twice except for one element that appears only once, your task is to find that unique number. This is a common problem that can be solved efficiently using bitwise XOR operation. Recall the property of XOR: for any integer \( a \), \( a \oplus a = 0 \) and \( a \oplus 0 = a \). Thus, when you XOR all numbers in the list, all elements that appear twice cancel out, leaving the unique element.

inputFormat

The input is given in two lines via standard input. The first line consists of a single integer \( n \) denoting the number of elements in the array. The second line contains \( n \) space-separated integers which represent the elements of the array.

outputFormat

Output a single line to standard output containing the unique integer which appears only once.

## sample
5
4 1 2 1 2
4