Created
January 13, 2020 22:16
-
-
Save amejiarosario/e104c919e3ff2d1193c736f21150f2df 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
powerset('') // ... | |
// n = 0, f(n) = 1; | |
powerset('a') // , a... | |
// n = 1, f(n) = 2; | |
powerset('ab') // , a, b, ab... | |
// n = 2, f(n) = 4; | |
powerset('abc') // , a, b, ab, c, ac, bc, abc... | |
// n = 3, f(n) = 8; | |
powerset('abcd') // , a, b, ab, c, ac, bc, abc, d, ad, bd, abd, cd, acd, bcd... | |
// n = 4, f(n) = 16; | |
powerset('abcde') // , a, b, ab, c, ac, bc, abc, d, ad, bd, abd, cd, acd, bcd... | |
// n = 5, f(n) = 32; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment