Clojure Golf: combinations
(defn combinations [& cs]
(reduce (fn [vs c]
(mapcat #(map conj vs (repeat %)) c))
[[]] cs))
(defn combinations [& cs]
(reduce (fn [vs c]
(mapcat #(map conj vs (repeat %)) c))
[[]] cs))
RSS feed for comments on this post. TrackBack URI
Nice. Glad to see you back!