Skip to content
C

Remove Duplicates from a Sorted Array

Easyjavapythonccppjavascript

Given a sorted array of N integers, remove duplicate values so that every distinct value appears only once, keeping the sorted order.

Input Format

The first line contains an integer N. The second line contains N space-separated integers in non-decreasing order.

Output Format

Print the distinct values in increasing order, separated by single spaces, on one line.

Input (stdin)

Output

Run your code to see output here...