My code in Java:
ArrayList list = new ArrayList();
list.addAll({1,2,1,3,4,5,2,3,4,3});
for (int i=0; i
or simply do this:
SetList unique = new SetList();
unique.addAll(list);
Both ways have Time = nk ~ O(n^2)
where n is the size of input list,
k is number of unique members of the input list