Skip to content
C

Remove Duplicates from Sorted Linked List

Easyjavapythonccppjavascript

Given a sorted linked list, remove nodes with repeated values so that every value appears only once.

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 list after removing duplicates, separated by single spaces.

Input (stdin)

Output

Run your code to see output here...