#C12653. Unique Elements
Unique Elements
Unique Elements
Given a list of integers, you are required to output a new list containing only the unique elements from the original list while preserving their original order of appearance. Formally, given a list \( A = [a_1, a_2, \dots, a_n] \), construct the list \( B \) such that each element appears only once in the order of its first occurrence. For example, given the list [1, 1, 2, 2, 3, 3]
, the unique list is [1, 2, 3]
.
inputFormat
The input is read from stdin and consists of two lines. The first line contains an integer \( n \) denoting the number of elements in the list. The second line contains \( n \) space-separated integers.
outputFormat
Output the unique elements in a single line separated by a single space, preserving the order of their first appearance. If the list is empty, output nothing.
## sample0