diff options
| author | Simon Proctor <simon.proctor@zoopla.co.uk> | 2020-08-25 11:17:23 +0100 |
|---|---|---|
| committer | Simon Proctor <simon.proctor@zoopla.co.uk> | 2020-08-25 11:17:23 +0100 |
| commit | ead308f663947f7031f362b9883e5fd5105d0322 (patch) | |
| tree | a8d9283d39b3dbfea925f820f88bcfe0f3ed87d0 /challenge-075/simon-proctor | |
| parent | 25f0d1da2eb93ba4ba6df4b0f615fa0c8145b7c7 (diff) | |
| download | perlweeklychallenge-club-ead308f663947f7031f362b9883e5fd5105d0322.tar.gz perlweeklychallenge-club-ead308f663947f7031f362b9883e5fd5105d0322.tar.bz2 perlweeklychallenge-club-ead308f663947f7031f362b9883e5fd5105d0322.zip | |
Show the smallest number of coins first
Diffstat (limited to 'challenge-075/simon-proctor')
| -rw-r--r-- | challenge-075/simon-proctor/raku/ch-1.raku | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/challenge-075/simon-proctor/raku/ch-1.raku b/challenge-075/simon-proctor/raku/ch-1.raku index 32c4e8d699..1ff6b48cfc 100644 --- a/challenge-075/simon-proctor/raku/ch-1.raku +++ b/challenge-075/simon-proctor/raku/ch-1.raku @@ -25,7 +25,7 @@ multi sub make-change( $amount, @coins ) { @result.push( [$coin, |@change] ); } } - @result = @result.map( { $_.sort.Array } ).unique( with => &[~~] ); + @result = @result.map( { $_.sort.reverse.Array } ).unique( with => &[~~] ).sort( { $^a.elems cmp $^b.elems } ); %change_cache{$amount} = @result; return @result; } |
