Power set: Difference between revisions

10 bytes removed ,  10 years ago
(Code crunch)
Line 468:
<lang Clojure>(defn powerset
[coll]
(reduce (fn [a x] (->> a (map #(set (concat #{x} %))) (concat a) set))
(set (concat a (map #(set (concat #{x} %)) a))))
#{#{}} coll))
 
Anonymous user