-2
Task:
Remove all duplicates from one list of integers. A list is simply a sequence of connected values that allows the same values to be stored at different positions in this sequence.
If an item was found to be the same value as another item in this list, keep the first occurence of the item and remove the second (third and so on...) occurence of the item.
Input/Output
You may write a function or full program that takes a list of integers as an input and returns a list without duplicates as an output.
Rules:
- This is a code-golf challenge, so shortest answer wins!
4I would have preferred leaving this question closed and creating a new one, since it is old and the edit invalidates almost all of the existing answers – Jo King – 2019-12-20T03:53:36.833
1@JoKing same here. I have no idea why/who reopened, but I thought it was best to clean it up if it was being reopened – Quintec – 2019-12-20T23:06:27.213
4Please state what you mean by a "list", and how the program will interact with this list (i.e. input/output) – user12205 – 2014-04-17T12:53:20.243