Skip to content

Instantly share code, notes, and snippets.

@KartikTalwar
Created January 18, 2012 01:16
String Combinations
def stringCombinations(string, right = ''):
if not string:
print right
return
stringCombinations(string[1:], string[0] + right)
stringCombinations(string[1:], right)
stringCombinations('abcd')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment