I am stuck with this exercise . How can I repeat an operation if I can still substract with the same coin.
Blockquote
def find_fewest_coins(coins, target):
change =
if target < 0 :
raise ValueError(“can’t make target with given coins”)
for index in reversed(range(len(coins))):
target -= coins[index] #substrcat until you can’t and move to next number
if target > 0:
change.append(coins[index])
else:
continue
if target == 0:
return change