diff --git a/lib/bill-math.js b/lib/bill-math.js index b093fd46..8d4515c2 100644 --- a/lib/bill-math.js +++ b/lib/bill-math.js @@ -116,14 +116,8 @@ const getSolution_old = (units, amount, mode) => { const solver = sumService.subsetSum(billList, amount.toNumber()) const solution = _.countBy(Math.floor, solver.next().value) - return _.reduce( - (acc, value) => { - acc.push({ denomination: _.toNumber(value), provisioned: solution[value] }) - return acc - }, - [], - _.keys(solution) - ) + return Object.entries(solution) + .map(([denomination, provisioned]) => [_.toNumber(denomination), provisioned]) } const getSolution = (units, amount) => {