Skip to content

Instantly share code, notes, and snippets.

@Netpilgrim
Created August 30, 2011 20:23
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 Netpilgrim/1181919 to your computer and use it in GitHub Desktop.
Save Netpilgrim/1181919 to your computer and use it in GitHub Desktop.
4clojure problem 43
(defn deinterleave
[coll n]
(->>
(loop [out [(take n coll)]
tail (drop n coll)]
(if (seq tail)
(recur (conj out (take n tail)) (drop n tail))
out))
(apply map vector)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment