Created
June 12, 2016 17:55
-
-
Save yask123/88a101070148853a5c5802a3e7c3b888 to your computer and use it in GitHub Desktop.
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
S = [1,2,3] | |
def get_subsets(arr,current_index, result): | |
if current_index == len(arr): | |
print result | |
return 1 | |
get_subsets(arr,current_index+1,result+str(arr[current_index])) | |
get_subsets(arr,current_index+1,result) | |
get_subsets(S,0,'') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment