- regis = {0.01, 0.05, 0.10, 0.25, 0.50, 1.00, 2.00, 5.00, 10.00, 20.00, 50.00, 100.00}
- def getChange(amount, curr, left):
- if sum(curr) == amount:
- return curr
- elif sum(curr) < amount:
- for x in left:
- res = getChange(amount, curr | {x}, left - {x})
- if len(res) > 0:
- return res
- else:
- return set()
- print(getChange(26, set(), regis))