Count the coins/0-1: Difference between revisions
m
→{{header|Raku}}: left one out
Thundergnat (talk | contribs) (→{{header|Raku}}: Add a Raku example) |
Thundergnat (talk | contribs) m (→{{header|Raku}}: left one out) |
||
Line 73:
=={{header|Raku}}==
This is pretty much duplicating other tasks, in process if not wording. First part is combinations filtered on a certain property. Second part (extra credit) is permutations of those combinations. Even though I am adding a solution, my vote would be for deletion as it doesn't really add anything to the other tasks
<lang perl6>sub which (*@items, :$sum-to) { ^@items .combinations.grep: { @items[$_].sum == $sum-to } }
|