All problems
MediumLists
Remove duplicates (preserve order)
Given a list with duplicates, return a list of unique items in their first-seen order.
- #lists
- #sets
Sample input
[1, 2, 1, 3, 2, 4]
Sample output
[1, 2, 3, 4]
remove-duplicates.py
Output
Press "Run code" to execute.
