Two Lonely Numbers
Every value appears exactly twice except two distinct values that appear once each. Print them in increasing order.
Input: the first line has N (even); the second line has N positive integers.
Output: the two singleton values, ascending.
Constraints:
- 2 ≤ N ≤ 105
- 1 ≤ ai ≤ 106
Sample Tests
Input 1
4 1 2 1 3
Output 1
2 3
Input 2
2 5 9
Output 2
5 9
Discussion (opens after you solve — no spoilers before)
No comments yet.