Skip to content

Instantly share code, notes, and snippets.

@msgodf
Created April 14, 2011 14:27
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 msgodf/919582 to your computer and use it in GitHub Desktop.
Save msgodf/919582 to your computer and use it in GitHub Desktop.
Solution to Conway's Look and Say sequence generation in Clojure
(defn seq-groups [seq]
(partition-by (fn [x] seq)))
(defn look-and-say [seq]
(interleave
(map count (seq-groups seq))
(map first (seq-groups seq))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment