Skip to content

Instantly share code, notes, and snippets.

@kzar
Last active January 2, 2016 07:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kzar/4be355c7f3b026cd22d5 to your computer and use it in GitHub Desktop.
Save kzar/4be355c7f3b026cd22d5 to your computer and use it in GitHub Desktop.
(defn power-set [s]
(reduce (fn [s x]
(into s (map #(conj % x) s)))
#{#{}} s))
; (powerset #{1 2})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment