4
answers
1
watching
175
views
dlak2019Lv1
28 Nov 2022
“Finger exercise: Use the tabular method to implement a dynamic programming solution that meets the specification
def make_change(coin_vals, change):
"""coin_vals is a list of positive ints and coin_vals[0] = 1
change is a positive int,
return the minimum number of coins needed to have a set of
coins the values of which sum to change. Coins may be used
more than once. For example, make_change([1, 5, 8], 11)
should return 3."""
“Finger exercise: Use the tabular method to implement a dynamic programming solution that meets the specification
def make_change(coin_vals, change):
"""coin_vals is a list of positive ints and coin_vals[0] = 1
change is a positive int,
return the minimum number of coins needed to have a set of
coins the values of which sum to change. Coins may be used
more than once. For example, make_change([1, 5, 8], 11)
should return 3."""
Read by 2 people
kapikad1451Lv6
25 Dec 2022
Read by 2 people
Read by 2 people
Read by 2 people