#C12738. Unique Elements Extraction
Unique Elements Extraction
Unique Elements Extraction
You are given a list of elements provided via standard input. The objective is to output the unique elements of the list while preserving the order in which they first appear. In other words, if an element appears more than once, only its first occurrence should be printed.
The input consists of an integer \(n\) on the first line which indicates the number of elements, followed by a second line containing \(n\) space-separated tokens. The tokens can be either numbers or strings.
The output should be a single line containing the unique elements separated by a single space. This problem tests your ability to process input, maintain order, and filter duplicates effectively.
inputFormat
The input is provided from standard input (stdin). The first line contains an integer \(n\), the number of elements in the list. The second line contains \(n\) space-separated tokens which may be integers or strings.
outputFormat
Output the unique elements from the input list on a single line, separated by a space, preserving their order of first appearance.
## sample0