Skip to content

Instantly share code, notes, and snippets.

@entrptaher
Last active May 12, 2020 14:14
Show Gist options
  • Save entrptaher/4428cb2f8b9627ba9f8957b8e29e6a0b to your computer and use it in GitHub Desktop.
Save entrptaher/4428cb2f8b9627ba9f8957b8e29e6a0b to your computer and use it in GitHub Desktop.
Programming tasks
/*
Given the input is a string
Print out all permutations and permutations of their capitalizations, in an array
All elements of the output array should contain all letters from the input
*/
function capitalPermutations(input){}
capitalPermutations("a") // => ["a", "A"]
capitalPermutations("ab") // => ["ab", "Ab", "aB", "ba", "Ba", "bA"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment