Skip to content

Instantly share code, notes, and snippets.

@yask123
Created June 12, 2016 17:55
Show Gist options
  • Save yask123/88a101070148853a5c5802a3e7c3b888 to your computer and use it in GitHub Desktop.
Save yask123/88a101070148853a5c5802a3e7c3b888 to your computer and use it in GitHub Desktop.
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