Last active
April 16, 2018 13:52
-
-
Save supcik/1324e8c160a842f65c6a20b2a54eb5d9 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
class RecursiveChangeMaker(): | |
def __init__(self, total, coins): | |
self.total = total | |
self.coins = coins | |
def solve(self): | |
def recSolver(total): | |
if total == 0: return 0 | |
return min([1 + recSolver(total-c) for c in self.coins if c <= total]) | |
return recSolver(self.total) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment