Created
January 13, 2020 22:32
-
-
Save amejiarosario/23778653056826d460c23d38d7304ba9 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
getPermutations('ab') // ab, ba... | |
// n = 2, f(n) = 2; | |
getPermutations('abc') // abc, acb, bac, bca, cab, cba... | |
// n = 3, f(n) = 6; | |
getPermutations('abcd') // abcd, abdc, acbd, acdb, adbc, adcb, bacd... | |
// n = 4, f(n) = 24; | |
getPermutations('abcde') // abcde, abced, abdce, abdec, abecd, abedc, acbde... | |
// n = 5, f(n) = 120; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment