#K44752. Extract Unique Elements in Order
Extract Unique Elements in Order
Extract Unique Elements in Order
Given an array of integers, your task is to output the unique elements in the order they first appeared. For an input array , you need to find the sequence such that each element in appears only once and in the order of their appearance in .
For example, if the input array is [3, 4, 3, 2, 4, 5], the output should be [3, 4, 2, 5].
inputFormat
The first line of input contains a single integer , denoting the number of elements in the array. The second line contains space-separated integers representing the array elements.
outputFormat
Output the unique elements in the order they appear in the array. Print the numbers separated by a space.## sample
6
3 4 3 2 4 5
3 4 2 5
</p>