Remove duplicate elements: Difference between revisions
Added 11l
Thundergnat (talk | contribs) m (→{{header|APL}}: Regularize non-standard header markup) |
Alextretyak (talk | contribs) (Added 11l) |
||
Line 10:
* Go through the list, and for each element, check the rest of the list to see if it appears again, and discard it if it does. The complexity is O(''n''<sup>2</sup>). The up-shot is that this always works on any type (provided that you can test for equality).
<br><br>
=={{header|11l}}==
{{trans|Python}}
<lang 11l>V items = [‘1’, ‘2’, ‘3’, ‘a’, ‘b’, ‘c’, ‘2’, ‘3’, ‘4’, ‘b’, ‘c’, ‘d’]
V unique = Array(Set(items))
print(unique)</lang>
{{out}}
<pre>
[1, 2, 3, 4, a, b, c, d]
</pre>
=={{header|360 Assembly}}==
|