#C1592. Remove Duplicates from a Sorted List

    ID: 44814 Type: Default 1000ms 256MiB

Remove Duplicates from a Sorted List

Remove Duplicates from a Sorted List

Given a sorted list of integers, your task is to remove duplicates in-place so that each element appears only once. The relative order of the unique elements must be maintained. The solution must work in O(n) time complexity.

Note: The input list is given in non-decreasing order. You are required to read from standard input and write the output to standard output.

inputFormat

The first line contains an integer \(n\), representing the number of elements in the list. The second line contains \(n\) space-separated integers in non-decreasing order.

outputFormat

Output a single line with the unique elements separated by a single space. If the list is empty, output an empty line.

## sample
6
1 1 2 2 3 3
1 2 3