Last active
June 30, 2023 14:46
-
-
Save prasadwrites/afa549f14195b749b0c2c559f241673c to your computer and use it in GitHub Desktop.
Combinations of strings
This file contains hidden or 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