Removing Duplicates · Compiler
Removing Duplicates
Parcel labels arrive one at a time. Keep the first occurrence of each distinct label and preserve their arrival order.
- Input
- Line 1 contains the number of labels n (1 to 100). Line 2 contains n space-separated labels of 1 to 12 lowercase ASCII letters each.
- Output
- Print the retained labels in order on one line, separated by spaces.
Compiler Explorer runs your code when you run or check it.
Loading your exercise draft…