diff options
| author | Asher Harvey-Smith <asherharveysmith@gmail.com> | 2024-04-16 12:29:04 +0100 |
|---|---|---|
| committer | Asher Harvey-Smith <asherharveysmith@gmail.com> | 2024-04-16 12:29:04 +0100 |
| commit | 8123fe93265cb43f46530e36c610160167c8cc2a (patch) | |
| tree | b85e8ea2dceadad3a16005180262964cef331789 | |
| parent | 3730ce23730bec6bc545a345c82f863cd7f9fe29 (diff) | |
| download | perlweeklychallenge-club-8123fe93265cb43f46530e36c610160167c8cc2a.tar.gz perlweeklychallenge-club-8123fe93265cb43f46530e36c610160167c8cc2a.tar.bz2 perlweeklychallenge-club-8123fe93265cb43f46530e36c610160167c8cc2a.zip | |
raku simplification
| -rw-r--r-- | challenge-265/asherbhs/raku/ch-2.raku | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/challenge-265/asherbhs/raku/ch-2.raku b/challenge-265/asherbhs/raku/ch-2.raku index 0488e9ec65..cca5dd9640 100644 --- a/challenge-265/asherbhs/raku/ch-2.raku +++ b/challenge-265/asherbhs/raku/ch-2.raku @@ -1,9 +1,6 @@ sub completing-word(Str:D $str, Str:D @str --> Str:D) { my $str-bag = $str.lc.comb.grep(/<[a..z]>/).Bag; - my @completing = @str.grep({ - my $other-bag = .lc.comb.Bag; - $str-bag.Set ⊆ $other-bag.Set and not $str-bag «>» $other-bag - }); + my @completing = @str.grep($str-bag ⊆ *.comb.Bag); @completing ?? @completing.min(*.chars) !! '' } |
