RosettaCodeData/Task/Remove-duplicate-elements/Frink/remove-duplicate-elements.frink
2023-07-01 13:44:08 -04:00

9 lines
316 B
Text

b = [1, 5, 2, 6, 6, 2, 2, 1, 9, 8, 6, 5]
// One way, using OrderedList. An OrderedList is a type of array that keeps
// its elements in order. The items must be comparable.
a = new OrderedList
println[a.insertAllUnique[b]]
// Another way, using the "set" datatype and back to an array.
println[toArray[toSet[b]]