#K67842. Remove Duplicates While Maintaining Order

    ID: 32732 Type: Default 1000ms 256MiB

Remove Duplicates While Maintaining Order

Remove Duplicates While Maintaining Order

You are given an array of integers. Your task is to remove duplicate integers from the array while keeping the order of the first occurrence of each integer.

Note: The order in which the numbers appear in the output should be the same as their first appearance in the input.

For example, given the array \( [1, 2, 3, 1, 2, 4, 5, 3, 6] \), the answer would be \( [1, 2, 3, 4, 5, 6] \) because duplicate occurrences are removed.

Input Format: The first line of input contains an integer \(n\), representing the number of elements in the array. The second line contains \(n\) space-separated integers.

Output Format: Output the unique integers in one line, separated by a single space.

inputFormat

The first line contains a single integer \(n\) \( (0 \le n \le 10^5) \) which denotes the number of elements in the array. The second line contains \(n\) space-separated integers.

outputFormat

Print the list of integers after removing all duplicates, maintaining the order of their first appearance. The integers should be separated by a single space. If the array is empty, output an empty line.

## sample
9
1 2 3 1 2 4 5 3 6
1 2 3 4 5 6