#C12633. Remove Duplicates from List
Remove Duplicates from List
Remove Duplicates from List
Given an array of integers, remove all duplicate entries while preserving the original order of first occurrences. In other words, for each number, only its first appearance should be retained in the output. For example, applying the procedure to ( [4, 5, 4, 2, 3, 2, 1, 5] ) should yield ( [4, 5, 2, 3, 1] ).
inputFormat
The input is provided via standard input as a single line of space-separated integers. If the list is empty, the input will be an empty line.
outputFormat
Output the resulting list of integers with duplicates removed, preserving the original order. The numbers must be separated by a single space. In case of an empty list, output nothing.## sample
4 5 4 2 3 2 1 5
4 5 2 3 1