#C2465. Find The Unique Number

    ID: 45784 Type: Default 1000ms 256MiB

Find The Unique Number

Find The Unique Number

You are given a list of integers in which every integer appears exactly twice except for one integer which appears only once. Your task is to find and output that unique integer.

Input Format: The first line contains an integer n representing the number of elements in the list. The second line contains n space-separated integers.

Output Format: Output a single integer — the one that appears only once.

It is guaranteed that there is exactly one such integer in the list.

The solution can be efficiently implemented using the XOR operation.

inputFormat

The input is read from standard input (stdin) and consists of two lines:

  • The first line contains an integer n — the total number of integers.
  • The second line contains n space-separated integers. Every integer except one appears exactly twice.

outputFormat

The output should be printed to standard output (stdout) and consist of a single integer — the unique number that appears only once.

## sample
1
1
1