Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
6-liner: price it solution in Clear category for Making Change by przemyslaw.daniel
def checkio(price, coins):
v = [0]+[price+1]*price
for c in coins:
for p in range(price-c+1):
v[p+c] = min(v[p]+1, v[p+c])
return v[-1] if v[-1] != price+1 else None
April 15, 2017
Comments: