Skip to content

Instantly share code, notes, and snippets.

@prasadwrites
Last active June 30, 2023 14:46
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