Skip to content

Instantly share code, notes, and snippets.

@yunsu3042
Created November 17, 2016 05:19
Show Gist options
  • Save yunsu3042/fe12de940b665181df5b983ccebc5dba to your computer and use it in GitHub Desktop.
Save yunsu3042/fe12de940b665181df5b983ccebc5dba to your computer and use it in GitHub Desktop.
def recursive(total,coin,n):
for y in range(total//coin[n]+1):
if n==0:
if total % coin[0] == 0:
global count
count +=1
break
else:
break
temp = total
temp = temp -coin[n]*y
recursive(temp,coin,n-1)
return count
def change(total,coin):
global count
count = 0
recursive(total,coin,len(coin)-1)
return count
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment