Mediumhasharrays
Remove Duplicates
Time limit 2 s · Memory 64 MBAcceptance: —Solved by: 0
Statement
The first line contains n, the second line contains n integers. Keep only the first occurrence of every value and print the numbers in that order on one line separated by spaces.
Examples
Example 1
Input
7 1 3 3 2 1 3 2
Output
1 3 2
Example 2
Input
4 5 5 5 5
Output
5
Constraints
- 1 ≤ n ≤ 10^5
- -10^9 ≤ a_i ≤ 10^9