DeleteDuplicates DeleteDuplicates[list] returns list with the duplicates removed. Attributes[DeleteDuplicates] := {Protected} Simple examples In[1]:= DeleteDuplicates[{b, a, b}] Out[1]= {b, a} In[2]:= DeleteDuplicates[foo[b, a, b]] Out[2]= foo[b, a] In[3]:= DeleteDuplicates[{}] Out[3]= {} In[4]:= Length[DeleteDuplicates[Range[10000]]] Out[4]= 10000