Uncovering the Lone Heart
Time Limit: 1.0 s
Memory Limit: 256.0 MB
Description
In your group of N friends, everyone is happily paired up with their significant other. Each friend has found their perfect match, and these pairs are represented in an array A of size N. In this array, each paired friend is assigned the same value, reflecting their partnership. For example, if friend 1 is paired with friend 2, they might both have the value 5 in the array.
However, there’s one friend who doesn’t have a partner—a unique individual who shows up alone. This friend is represented by a unique value in the array, different from all the others who are part of a pair.
Your mission is to find this lone friend by identifying the unique value in the array A. With all your friends’ values mixing together, can you pinpoint the one value that doesn’t have a match? Use your skills to uncover the truth and find the friend who’s still flying solo in the group!
NOTE: It is guaranteed that N will be an odd number
Input
The first line contains an integer value N(1 ≤ N < \(10^5\))
The second line contais N integers \(A_1\) , \(A_2\) ,,, \(A_N\) (1 ≤ \(A\) ≤ \(10 ^ {9}\))
Output
Print the lonely soul person.
Sample
Input | Output |
---|---|
|
|
Information
- ID
- 1095
- Difficulty
- 1
- Category
- Beginners Click to Show
- Tags
- # Submissions
- 119
- Accepted
- 102
- Accepted Ratio
- 86%
- Uploaded By
Related
In following contests: