Created
November 17, 2016 05:19
-
-
Save yunsu3042/fe12de940b665181df5b983ccebc5dba 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
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