diff options
| -rw-r--r-- | challenge-111/luca-ferrari/raku/ch-2.p6 | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/challenge-111/luca-ferrari/raku/ch-2.p6 b/challenge-111/luca-ferrari/raku/ch-2.p6 new file mode 100644 index 0000000000..d35c9d3662 --- /dev/null +++ b/challenge-111/luca-ferrari/raku/ch-2.p6 @@ -0,0 +1,11 @@ +#!raku + + +sub MAIN( Str $words-file-name = '/usr/share/dict/words' ) { + my %words; + + %words{ $_.chars }.push: $_ if ( $_.fc ~~ $_.fc.split( '' ).sort.join ) + for $words-file-name.IO.lines(); + + %words{ %words.keys.sort[ * - 1 ] }.join( "\n" ).say; +} |
