Remove duplicate elements: Difference between revisions
m
→{{header|Go}}: reference associative arrays task
m (→{{header|Go}}: reference associative arrays task) |
|||
Line 540:
fmt.Println(uniq([]int {1,2,3,2,3,4})) // prints: [3 1 4 2]
}</lang>
replace "int" with another type
It takes only small changes to the above code to preserver order. Just store the sequence in the map:
|