Clojure Golf: subsets
(defn subsets [s]
(reduce (fn [ss x] (concat ss (map #(conj % x) ss))) [#{}] s))
(defn subsets [s]
(reduce (fn [ss x] (concat ss (map #(conj % x) ss))) [#{}] s))
No comments yet.
RSS feed for comments on this post. TrackBack URI