Created
August 30, 2011 20:23
-
-
Save Netpilgrim/1181919 to your computer and use it in GitHub Desktop.
4clojure problem 43
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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