Last active
June 30, 2023 14:46
Combinations of strings
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
#! /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