Arrays · 21 / 23 Exercise Medium

Remove duplicates keeping the order

Objective

Turning a list into a set removes repeats but loses the order. To keep it you must remember which items have already been seen.

Instructions

  • Read a line of space-separated words.
  • Show the words without repeats, in order of first appearance, separated by spaces.
Input
b a b c a
Output
b a c

Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.

Start exercise