Skip to content

Instantly share code, notes, and snippets.

@qbg
Created December 27, 2010 19:46
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 qbg/756469 to your computer and use it in GitHub Desktop.
Save qbg/756469 to your computer and use it in GitHub Desktop.
(defn merge-colls
[input]
(lazy-seq
(let [biggest (first (apply max-key #(first (second %)) input))
new-input (update-in input [biggest] next)]
(cons biggest (merge-colls new-input)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment