Problems > The lonely number

Problem Statement

To the great numbers party, pairs of numbers were invited. Alas, apparently a single number was able to infiltrate the party.

Your mission is to find the intruder and let our security stuff know who he is.

In the first line of input there is a single number N which is the number of numbers currently in the party. (This number will always be a positive odd number, and may be very large)
The second input line contains a list of numbers in the party. (All numbers are Integers, between -1,000,000 and 1,000,000)

The output should include a single number, the one that has no pair.

Important notice - there might be several pairs having the same number.

Sample input #1

5
1 1 2 2 3

Sample output #1

3

Sample input #2

7
8 -1 -1 -2 3 -2 8

Sample output #2

3
You must be logged in to submit