Clojure Golf: combinations (2)
(defn combinations [& cs]
(reduce #(for [v %1 i %2] (conj v i)) [[]] cs))
(defn combinations [& cs]
(reduce #(for [v %1 i %2] (conj v i)) [[]] cs))
(defn combinations [& cs]
(reduce (fn [vs c]
(mapcat #(map conj vs (repeat %)) c))
[[]] cs))