#C14995. Remove Duplicate Numbers
Remove Duplicate Numbers
Remove Duplicate Numbers
You are given a list of integers. Your task is to remove the duplicate numbers while preserving the order of their first occurrence.
For example, if the input list is:
then the output should be:
Make sure to read the input from standard input (stdin) and write your answer to standard output (stdout).
inputFormat
The input begins with a single integer n representing the number of elements in the list. The next line contains n integers separated by spaces.
For example:
7 4 5 6 4 7 6 8
outputFormat
Output the list after removing duplicates. The numbers should be printed in a single line separated by a single space.
For example, the output for the above input should be:
4 5 6 7 8## sample
7
4 5 6 4 7 6 8
4 5 6 7 8