There is a list L. It contains elements of arbitrary type each. How to delete all duplicate elements in such list efficiently? ORDE
If the order does not matter, you might want to try this algorithm written in Python:
>>> array = [1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6] >>> unique = set(array) >>> list(unique) [1, 2, 3, 4, 5, 6]