aboutsummaryrefslogtreecommitdiff
path: root/challenge-075/simon-proctor
diff options
context:
space:
mode:
authorSimon Proctor <simon.proctor@zoopla.co.uk>2020-08-25 11:17:23 +0100
committerSimon Proctor <simon.proctor@zoopla.co.uk>2020-08-25 11:17:23 +0100
commitead308f663947f7031f362b9883e5fd5105d0322 (patch)
treea8d9283d39b3dbfea925f820f88bcfe0f3ed87d0 /challenge-075/simon-proctor
parent25f0d1da2eb93ba4ba6df4b0f615fa0c8145b7c7 (diff)
downloadperlweeklychallenge-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.raku2
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;
}