aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohammad S Anwar <Mohammad.Anwar@yahoo.com>2021-05-06 21:22:35 +0100
committerGitHub <noreply@github.com>2021-05-06 21:22:35 +0100
commitaaf39879344bd395eb101ebccdff06f6689df342 (patch)
treef882e7a17899f02f2d3c9ea040bf3a2a8d69e6f3
parent04cc2a7bd400398ebe561b075b73a461f5c3c434 (diff)
parent05706d2ad5f54d10b0f7d8d3d5e53c1b00280807 (diff)
downloadperlweeklychallenge-club-aaf39879344bd395eb101ebccdff06f6689df342.tar.gz
perlweeklychallenge-club-aaf39879344bd395eb101ebccdff06f6689df342.tar.bz2
perlweeklychallenge-club-aaf39879344bd395eb101ebccdff06f6689df342.zip
Merge pull request #4024 from Scimon/master
Find the longest word thing
-rw-r--r--challenge-111/simon-proctor/raku/ch-2.raku6
1 files changed, 6 insertions, 0 deletions
diff --git a/challenge-111/simon-proctor/raku/ch-2.raku b/challenge-111/simon-proctor/raku/ch-2.raku
new file mode 100644
index 0000000000..bc37b55523
--- /dev/null
+++ b/challenge-111/simon-proctor/raku/ch-2.raku
@@ -0,0 +1,6 @@
+#!/usr/bin/env raku
+
+#| Find the longest word in the given list that when sorted alphabetically is the same
+sub MAIN( $dict = "/etc/dictionaries-common/words" ) {
+ $dict.IO.lines.hyper.grep( { $_.lc ~~ $_.lc.split("").sort.join("") } ).sort( *.chars ).reverse.first.say;
+}