Skip to content

Instantly share code, notes, and snippets.

@prasadwrites
Last active June 30, 2023 14:46
Show Gist options
  • Select an option

  • Save prasadwrites/afa549f14195b749b0c2c559f241673c to your computer and use it in GitHub Desktop.

Select an option

Save prasadwrites/afa549f14195b749b0c2c559f241673c to your computer and use it in GitHub Desktop.
Combinations of strings
#! /bin/env/path python
def printCombinations(slate,array):
if (len(array)==0):
print(slate)
return
printCombinations(slate,array[1:])
printCombinations(slate+array[0], array[1:])
printCombinations("", "abcd")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment