#C9641. Unique Elements Extraction
Unique Elements Extraction
Unique Elements Extraction
You are given a list of integers. Your task is to output only the unique elements in the same order as they first appear in the list.
For example, if the input list is [4, 5, 4, 6, 5, 7, 8]
, the expected output is [4, 5, 6, 7, 8]
.
Make sure to read input from stdin and output your answer to stdout. The input format is described below.
If there are no elements in the input list, output should be empty.
The function must preserve the order of first appearance.
There are no hidden tricks in this problem.
inputFormat
The first line contains an integer n representing the number of elements in the list. The second line contains n space-separated integers representing the list elements.
Note: When n is zero, the second line may be empty.
outputFormat
Output the unique elements of the list in a single line separated by a single space.
If there are no elements, output nothing.
## sample5
1 2 3 4 5
1 2 3 4 5
</p>