fix: error if unequal
This commit is contained in:
parent
8e33bc527d
commit
9338aeb266
1 changed files with 1 additions and 1 deletions
|
|
@ -155,7 +155,7 @@ function makeChange(outCassettes, amount) {
|
||||||
const ss_solution = getSolution_old(outCassettes, amount, BILL_LIST_MODES.VALUE_ROUND_ROBIN)
|
const ss_solution = getSolution_old(outCassettes, amount, BILL_LIST_MODES.VALUE_ROUND_ROBIN)
|
||||||
const cc_solution = getSolution(outCassettes, amount)
|
const cc_solution = getSolution(outCassettes, amount)
|
||||||
|
|
||||||
if (!!ss_solution === !!cc_solution) {
|
if (!!ss_solution !== !!cc_solution) {
|
||||||
logger.error(new Error(`subset-sum and coin-change don't agree on solvability -- subset-sum:${!!ss_solution} coin-change:${!!cc_solution}`))
|
logger.error(new Error(`subset-sum and coin-change don't agree on solvability -- subset-sum:${!!ss_solution} coin-change:${!!cc_solution}`))
|
||||||
return solutionToOriginalUnits(ss_solution, outCassettes)
|
return solutionToOriginalUnits(ss_solution, outCassettes)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue