spacepaste

  1.  
  2. 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}
  3. def getChange(amount, curr, left):
  4. if sum(curr) == amount:
  5. return curr
  6. elif sum(curr) < amount:
  7. for x in left:
  8. res = getChange(amount, curr | {x}, left - {x})
  9. if len(res) > 0:
  10. return res
  11. else:
  12. return set()
  13. print(getChange(26, set(), regis))
  14.