🎉 Taro is joining Handshake and we need 10,000 Software Engineers in the US/Canada to advance AI 🎉
Taro Logo
892
3 Likes

DSA Crash Course [Part 73] - Minimum Change Approach

In this lesson, Alvin explores the strategy to solving the following interview problem:

Write a function min_change that takes in an amount and a list of coins. The function should return the minimum number of coins required to create the amount. You may use each coin as many times as necessary.

If it is not possible to create the amount, then return -1.

min_change(8, [1, 5, 4, 12])