coin_change.ts
TypeScript 5.9
Not run yet
+ 7 hidden
Input
coins = [1, 5, 6, 9] amount = 11
Expected
2
5 + 6 pays 11 with two coins. Taking the largest coin first gives 9 + 1 + 1, three coins.
+ 7 hidden
coins = [1, 5, 6, 9] amount = 11
2
5 + 6 pays 11 with two coins. Taking the largest coin first gives 9 + 1 + 1, three coins.