eolymp
bolt
Try our new interface for solving problems
Problems

Remove Duplicates from Sorted Array

Remove Duplicates from Sorted Array

Given a sorted array, remove the duplicates such that each element appears only once. \InputFile The first line contains the size $n~(1 \le n \le 100)$ of array. The second line gives $n$ integers in sorted order, each number is no greater than $100$ by absolute value. \OutputFile Print the sorted array with removed duplicates.
Time limit 1 second
Memory limit 128 MiB
Input example #1
9
-2 -2 0 1 1 2 4 4 5
Output example #1
-2 0 1 2 4 5
Input example #2
8
6 6 6 7 7 8 9 10
Output example #2
6 7 8 9 10