Find minimum number of coins that make a given value: Difference between revisions
Find minimum number of coins that make a given value (view source)
Revision as of 22:38, 10 September 2021
, 2 years ago→{{header|JavaScript}}
m (→{{header|JavaScript}}: Used abs in test.) |
|||
Line 326:
const f = change([200, 100, 50, 20, 10, 5, 2, 1]);
return [1024, 988].
const
report = f(n).
(a, [q, u]) => `${a}${q} * ${u}\n`,
return `${acc}Summing to ${abs(n)}:\n
`${report}
);
},
""
);
};
|