RosettaCodeData/Task/Remove-duplicate-elements/D/remove-duplicate-elements-2.d

11 lines
191 B
D
Raw Permalink Normal View History

2013-04-10 23:57:08 -07:00
void main() {
2013-10-27 22:24:23 +00:00
import std.stdio;
immutable data = [1, 3, 2, 9, 1, 2, 3, 8, 8, 1, 0, 2];
2013-04-10 23:57:08 -07:00
2013-10-27 22:24:23 +00:00
bool[int] hash;
2013-04-10 23:57:08 -07:00
foreach (el; data)
2013-10-27 22:24:23 +00:00
hash[el] = true;
hash.byKey.writeln;
2013-04-10 23:57:08 -07:00
}