diff options
| -rw-r--r-- | challenge-207/wlmb/blog.txt | 2 | ||||
| -rwxr-xr-x | challenge-207/wlmb/perl/ch-1.pl | 12 | ||||
| -rwxr-xr-x | challenge-207/wlmb/perl/ch-2.pl | 12 |
3 files changed, 26 insertions, 0 deletions
diff --git a/challenge-207/wlmb/blog.txt b/challenge-207/wlmb/blog.txt new file mode 100644 index 0000000000..a505d8681e --- /dev/null +++ b/challenge-207/wlmb/blog.txt @@ -0,0 +1,2 @@ +https://wlmb.github.io/2023/03/06/PWC207/ + diff --git a/challenge-207/wlmb/perl/ch-1.pl b/challenge-207/wlmb/perl/ch-1.pl new file mode 100755 index 0000000000..c21d841bea --- /dev/null +++ b/challenge-207/wlmb/perl/ch-1.pl @@ -0,0 +1,12 @@ +#!/usr/bin/env perl +# Perl weekly challenge 207 +# Task 1: Keyboard Word +# +# See https://wlmb.github.io/2023/03/06/PWC207/#task-1-keyboard-word +use v5.36; +die <<~"FIN" unless @ARGV; + Usage: $0 W1 [W2...] + to find which of the words W1 W2... may be written using a single keyboard row. + FIN +say join " ", @ARGV, "->", + grep {/^([qwertyuiop]+|[asdfghjkl]+|[zxcvbnm]+)$/i} @ARGV; diff --git a/challenge-207/wlmb/perl/ch-2.pl b/challenge-207/wlmb/perl/ch-2.pl new file mode 100755 index 0000000000..d007b11f81 --- /dev/null +++ b/challenge-207/wlmb/perl/ch-2.pl @@ -0,0 +1,12 @@ +#!/usr/bin/env perl +# Perl weekly challenge 207 +# Task 2: H-Index +# +# See https://wlmb.github.io/2023/03/06/PWC207/#task-2-h-index +use v5.36; +my $h=0; +for(sort{$b<=>$a}@ARGV){ + last if $_<=$h; + ++$h +} +say join " ", @ARGV, "->", $h; |
