Haskell,
pasted
on Jan 2:
|
import List
my_list = ["one", "one", "one", "one", "two", "three", "three", "one", "one", "four", "five", "five", "five", "five"]
main = print [head xs | xs <- group my_list]
|
Output:
|
["one","two","three","one","four","five"]
|
|