• (subsets items)
All the subsets of items

2 Examples top

  • (subsets #{1, 2, 3})
  • (subsets ["apple", "orange", "banana"])
Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/contrib/combinatorics.clj:101 top

(defn subsets
  "All the subsets of items"
  (mapcat (fn [n] (combinations items n))
	  (range (inc (count items)))))
Vars in clojure.contrib.combinatorics/subsets: count defn fn inc mapcat range
Used in 0 other vars

Comments top

No comments for subsets. Log in to add a comment.