I hereby claim:
- I am lshin on github.
- I am leos (https://keybase.io/leos) on keybase.
- I have a public key ASBL4teoAuvP1WUX0Ss8IagRMBmdaOxtDtFIytHwhZG9Awo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
import sys | |
def coin_change(coins, amount): | |
coin_amounts = [sys.maxint] * (amount + 1) | |
coin_amounts[0] = 0 | |
for i in range(amount + 1): | |
if coin_amounts[i] != sys.maxint: | |
for coin in coins: | |
if i + coin <= amount: | |
coin_amounts[i + coin] = min(coin_amounts[i + coin], coin_amounts[i] + 1) | |
return coin_amounts[amount] if coin_amounts[amount] != sys.maxint else -1 |
I hereby claim:
To claim this, I am signing this object: