Skip to content

Instantly share code, notes, and snippets.

Created April 23, 2011 06:33
Show Gist options
  • Save anonymous/938402 to your computer and use it in GitHub Desktop.
Save anonymous/938402 to your computer and use it in GitHub Desktop.
;; peteris's solution to http://4clojure.com/problem/50
#(loop [s %, acu {}]
(if (= '() s)
(map reverse (vals acu))
(recur (rest s)
(if (nil? (find acu (type (first s))))
(assoc acu (type (first s)) (list (first s)))
(assoc acu (type (first s)) (cons (first s) (get acu (type (first s)))))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment