Find Duplicate Values
Easyjavapythonccppjavascript
Given an array, find every value that occurs more than once.
Input Format
The first line contains an integer N. The second line contains N space-separated integers.
Output Format
Print the distinct duplicated values in increasing order, separated by single spaces. If there are none, print an empty line.
Example 1
Input
7 1 3 4 3 5 1 6
Output
1 3
Explanation: 1 and 3 each appear more than once.
- 1 <= N <= 100000
- -1000000000 <= A[i] <= 1000000000