aboutsummaryrefslogtreecommitdiff
path: root/challenge-328
diff options
context:
space:
mode:
authorMohammad Sajid Anwar <Mohammad.Anwar@yahoo.com>2025-07-02 23:30:57 +0100
committerGitHub <noreply@github.com>2025-07-02 23:30:57 +0100
commit06ac6987b698821c98b81cf997383bd8acd2e693 (patch)
treeeec70ee9734aef4781a801af730ed39a65b84d3f /challenge-328
parentaf47e7f11b315d4bdb06ca2203d8857c0d2c176f (diff)
parent789eacdb4afb5d82955045d0fdcb1e7debe72562 (diff)
downloadperlweeklychallenge-club-06ac6987b698821c98b81cf997383bd8acd2e693.tar.gz
perlweeklychallenge-club-06ac6987b698821c98b81cf997383bd8acd2e693.tar.bz2
perlweeklychallenge-club-06ac6987b698821c98b81cf997383bd8acd2e693.zip
Merge pull request #12270 from deadmarshal/TWC328
TWC328
Diffstat (limited to 'challenge-328')
-rw-r--r--challenge-328/deadmarshal/blog.txt1
-rw-r--r--challenge-328/deadmarshal/perl/ch-1.pl14
-rw-r--r--challenge-328/deadmarshal/perl/ch-2.pl15
3 files changed, 30 insertions, 0 deletions
diff --git a/challenge-328/deadmarshal/blog.txt b/challenge-328/deadmarshal/blog.txt
new file mode 100644
index 0000000000..1ee73a1e27
--- /dev/null
+++ b/challenge-328/deadmarshal/blog.txt
@@ -0,0 +1 @@
+https://deadmarshal.blogspot.com/2025/06/twc328.html
diff --git a/challenge-328/deadmarshal/perl/ch-1.pl b/challenge-328/deadmarshal/perl/ch-1.pl
new file mode 100644
index 0000000000..3214e4c42d
--- /dev/null
+++ b/challenge-328/deadmarshal/perl/ch-1.pl
@@ -0,0 +1,14 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+
+sub replace_all{
+ my %h = map{$_ => 1} split '',$_[0];
+ my @chars = grep{!exists $h{$_}} 'a'..'z';
+ $_[0] =~ s/\?/$chars[0]/r
+}
+
+printf "%s\n",replace_all('a?z');
+printf "%s\n",replace_all('pe?k');
+printf "%s\n",replace_all('gra?te');
+
diff --git a/challenge-328/deadmarshal/perl/ch-2.pl b/challenge-328/deadmarshal/perl/ch-2.pl
new file mode 100644
index 0000000000..fdf79b86a3
--- /dev/null
+++ b/challenge-328/deadmarshal/perl/ch-2.pl
@@ -0,0 +1,15 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+
+sub good_string{
+ my ($str) = @_;
+ my $chars = join '|',map{"$_\u$_|\u$_$_"} 'a'..'z';
+ 1 while $str =~ s/$chars//;
+ $str
+}
+
+printf "%s\n",good_string('WeEeekly');
+printf "%s\n",good_string('abBAdD');
+printf "%s\n",good_string('abc');
+