Added 2 Base tests and 5 main tests for CoinChange Problem. Refactored the code and removed the Memoized approach as it was not necessary

This commit is contained in:
Mandy8055
2021-08-13 12:56:42 +05:30
parent fa1524498b
commit 43e9ebc702

View File

@ -15,7 +15,7 @@ export const change = (coins, amount) => {
} }
return combinations[amount] return combinations[amount]
} }
function minimumCoins(coins, amount) { function minimumCoins (coins, amount) {
// minimumCoins[i] will store the minimum coins needed for amount i // minimumCoins[i] will store the minimum coins needed for amount i
const minimumCoins = new Array(amount + 1).fill(0) const minimumCoins = new Array(amount + 1).fill(0)