Skip to content

Instantly share code, notes, and snippets.

@mullr
Created September 17, 2011 08:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mullr/1223758 to your computer and use it in GitHub Desktop.
Save mullr/1223758 to your computer and use it in GitHub Desktop.
So many vecs!
(partial reduce
(fn [acc n]
(if (= (first (last acc)) n)
(vec (conj (vec (butlast acc)) (conj (last acc) n)))
(vec (conj acc [n]))))
[])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment