#K61647. Unique Integers
Unique Integers
Unique Integers
You are given a list of integers. Your task is to output a list that contains only the unique integers in the order of their first appearance.
For example, given the list [1, 2, 2, 3, 4, 4, 5]
, the output should be [1, 2, 3, 4, 5]
.
The problem can be formulated as follows. Given an integer \( n \) representing the count of numbers and a sequence \( a_1, a_2, \dots, a_n \), output the unique integers in the order they first appear. In other words, if \( s = [a_1, a_2, \dots, a_n] \) then produce a list \( [b_1, b_2, \dots, b_k] \) where every \( b_i \) is distinct and for each \( b_i \), it is the first occurrence in \( s \).
inputFormat
The first line contains an integer \( n \) which denotes the number of integers. The second line contains \( n \) space-separated integers.
outputFormat
Output the unique integers in their original order separated by a single space.
## sample7
1 2 2 3 4 4 5
1 2 3 4 5
</p>