Created
April 4, 2014 23:19
-
-
Save RubyBrewsday/9984938 to your computer and use it in GitHub Desktop.
This file contains 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
Bonus: subsets | |
Attempt this after you have the other two problems working. | |
Write a method that, given an array of unique items, finds all the subsets of items: | |
subsets(["a", "b", "c"]) == [ | |
[], # note that the empty set counts! | |
["a"], ["a", "b"], ["a", "b", "c"], ["a", "c"] | |
["b"], ["b", "c"], | |
["c"] | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment