Monday, December 18, 2017

Unique With Order Preserved

Remove duplicates from a list with order preserved.


function unique(m)=
     [for(i=[0:len(m)-1])if(search([m[i]],m,1)==[i])m[i]];
 

1 comment: