mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-05 16:26:47 +08:00
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:
@ -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)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user