2021-06-05から1日間の記事一覧
Python coins = (1, 2, 5, 10, 20, 50, 100, 200) memo = {} def first_denomination(kinds_of_coins): return coins[kinds_of_coins - 1] def count_change(amount, kinds_of_coins): if (amount, kinds_of_coins) in memo: return memo[(amount, kinds_of_…