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 18:56, 31 October 2023
, 7 months ago→J: add
imported>AldoBaldo No edit summary |
(→J: add) |
||
Line 714:
1 * 2
1 * 1</pre>
=={{header|J}}==
<syntaxhighlight lang="j">0 0 $ (| [ <.@%~ 1!:2&2@, [)/ 1 2 5 10 20 50 100 200 , 988</syntaxhighlight>
{{out}}
<pre>4 200
1 100
1 50
1 20
1 10
1 5
1 2
1 1</pre>
=={{header|JavaScript}}==
|