#C8040. Remove Duplicates and Sort
Remove Duplicates and Sort
Remove Duplicates and Sort
You are given a list of integers. Your task is to remove all duplicate numbers and then print the resulting list in sorted order. Formally, given a sequence of integers \(a_1, a_2, \dots, a_n\), you need to output the set \(\{a_1, a_2, \dots, a_n\}\) in ascending order.
Example:
Input: 7 4 5 6 4 2 3 2</p>Output: 2 3 4 5 6
Make sure to handle edge cases such as an empty list or a list where all elements are the same.
inputFormat
The first line contains an integer \(n\) which represents the number of elements in the list. The second line contains \(n\) integers separated by a single space.
outputFormat
Print the sorted list of unique integers in one line with each number separated by a single space.
## sample7
4 5 6 4 2 3 2
2 3 4 5 6
</p>