diff options
| -rw-r--r-- | challenge-055/simon-proctor/raku/ch-2.p6 | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/challenge-055/simon-proctor/raku/ch-2.p6 b/challenge-055/simon-proctor/raku/ch-2.p6 index aee75ea167..40d1f60451 100644 --- a/challenge-055/simon-proctor/raku/ch-2.p6 +++ b/challenge-055/simon-proctor/raku/ch-2.p6 @@ -17,16 +17,7 @@ multi sub MAIN( *@input where { $_.elems >= 2 && $_.all ~~ Int } ) { } sub unique-perms ( @input ) { - my %seen; - my @perms = @input.permutations; - gather { - while ( @perms ) { - my $next = @perms.shift; - next if %seen{$next}:exists; - %seen{$next} = True; - take $next; - } - } + @input.permutations.unique(:as(*.join(","))); } multi sub is-wave( 'lte', Int $a, Int $b where { $a <= $b } ) { True } |
