Created
December 28, 2014 14:39
-
-
Save secwang/0d332f0e9fce78e8e2f5 to your computer and use it in GitHub Desktop.
snippets for subset of list
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defn subsets [things] | |
| (if (empty? things) '(()) | |
| (let [srt (subsets (rest things))] | |
| (concat (map #(cons (first things) %) srt) srt)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment