Say I have a list
[0, 1, 1, 3, 4, 5, 5, 1, 1, 1]
And output I would want for this list would be:
[0, 1, 3, 4, 5, 1]
My first thought was to do by sorting but I still want elements to remain as they are with the example of the ones above and in the same order. How would I do this?
I would prefer pseudocode, hints, or python please!