Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (fn [seq n]
- (loop [acc (vec (repeat n nil)) i 0 tail seq]
- (let [i' (mod i n)]
- (cond (empty? tail) (apply list acc)
- :else (recur (assoc acc i' (concat (nth acc i') (list (first tail)))) (+ i 1) (rest tail))))))
Add Comment
Please, Sign In to add comment