aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohammad Sajid Anwar <mohammad.anwar@yahoo.com>2025-09-23 00:21:05 +0100
committerMohammad Sajid Anwar <mohammad.anwar@yahoo.com>2025-09-23 00:21:05 +0100
commitc814a4f210ee95fc6d6c6386bfd42f4c254f14ee (patch)
treebd89b3e3c0ee8fc21689ea8363ae5e27bb07ebed
parentb2088575838ffcb2854f2d1f5988706d4f021ed9 (diff)
downloadperlweeklychallenge-club-c814a4f210ee95fc6d6c6386bfd42f4c254f14ee.tar.gz
perlweeklychallenge-club-c814a4f210ee95fc6d6c6386bfd42f4c254f14ee.tar.bz2
perlweeklychallenge-club-c814a4f210ee95fc6d6c6386bfd42f4c254f14ee.zip
- Added solution to task 1 of week 340.
-rw-r--r--challenge-340/mohammad-anwar/perl/ch-1.pl31
-rw-r--r--stats/pwc-current.json17
-rw-r--r--stats/pwc-language-breakdown-2019.json2
-rw-r--r--stats/pwc-language-breakdown-2020.json2
-rw-r--r--stats/pwc-language-breakdown-2021.json2
-rw-r--r--stats/pwc-language-breakdown-2022.json2
-rw-r--r--stats/pwc-language-breakdown-2023.json2
-rw-r--r--stats/pwc-language-breakdown-2024.json2
-rw-r--r--stats/pwc-language-breakdown-2025.json6
-rw-r--r--stats/pwc-language-breakdown-summary.json4
-rw-r--r--stats/pwc-leaders.json6
-rw-r--r--stats/pwc-summary-1-30.json2
-rw-r--r--stats/pwc-summary-121-150.json2
-rw-r--r--stats/pwc-summary-151-180.json2
-rw-r--r--stats/pwc-summary-181-210.json4
-rw-r--r--stats/pwc-summary-211-240.json2
-rw-r--r--stats/pwc-summary-241-270.json2
-rw-r--r--stats/pwc-summary-271-300.json2
-rw-r--r--stats/pwc-summary-301-330.json2
-rw-r--r--stats/pwc-summary-31-60.json4
-rw-r--r--stats/pwc-summary-61-90.json2
-rw-r--r--stats/pwc-summary-91-120.json2
-rw-r--r--stats/pwc-summary.json6
-rw-r--r--stats/pwc-yearly-language-summary.json6
24 files changed, 80 insertions, 34 deletions
diff --git a/challenge-340/mohammad-anwar/perl/ch-1.pl b/challenge-340/mohammad-anwar/perl/ch-1.pl
new file mode 100644
index 0000000000..a4fb1be1a8
--- /dev/null
+++ b/challenge-340/mohammad-anwar/perl/ch-1.pl
@@ -0,0 +1,31 @@
+#!/usr/bin/env perl
+
+use v5.38;
+use Test::More;
+
+my $examples = {
+ 1 => { str => 'abbaca', exp => 'ca' },
+ 2 => { str => 'azxxzy', exp => 'ay' },
+ 3 => { str => 'aaaaaaaa', exp => '' },
+ 4 => { str => 'aabccba', exp => 'a' },
+ 5 => { str => 'abcddcba', exp => '' },
+};
+
+foreach my $id (keys %$examples) {
+ is(remove_duplicates($examples->{$id}->{str}), $examples->{$id}->{exp})
+}
+
+done_testing;
+
+sub remove_duplicates($str) {
+ return $str if length($str) < 2;
+
+ for (my $i = 0; $i < length($str) - 1; $i++) {
+ if (substr($str, $i, 1) eq substr($str, $i + 1, 1)) {
+ my $new_str = substr($str, 0, $i) . substr($str, $i + 2);
+ return remove_duplicates($new_str);
+ }
+ }
+
+ return $str;
+}
diff --git a/stats/pwc-current.json b/stats/pwc-current.json
index 3a19d4ea74..e2dfa1b980 100644
--- a/stats/pwc-current.json
+++ b/stats/pwc-current.json
@@ -88,6 +88,16 @@
"data" : [
[
"Perl",
+ 1
+ ]
+ ],
+ "id" : "Mohammad Sajid Anwar",
+ "name" : "Mohammad Sajid Anwar"
+ },
+ {
+ "data" : [
+ [
+ "Perl",
2
]
],
@@ -229,6 +239,11 @@
"y" : 2
},
{
+ "drilldown" : "Mohammad Sajid Anwar",
+ "name" : "Mohammad Sajid Anwar",
+ "y" : 1
+ },
+ {
"drilldown" : "Niels van Dijke",
"name" : "Niels van Dijke",
"y" : 2
@@ -268,7 +283,7 @@
}
],
"subtitle" : {
- "text" : "[Champions: 15] Last updated at 2025-09-22 23:07:20 GMT"
+ "text" : "[Champions: 16] Last updated at 2025-09-22 23:21:00 GMT"
},
"title" : {
"text" : "The Weekly Challenge - 340"
diff --git a/stats/pwc-language-breakdown-2019.json b/stats/pwc-language-breakdown-2019.json
index 58d553c29a..420f9d73b1 100644
--- a/stats/pwc-language-breakdown-2019.json
+++ b/stats/pwc-language-breakdown-2019.json
@@ -970,7 +970,7 @@
}
],
"subtitle" : {
- "text" : "Click the columns to drilldown the language breakdown. Last updated at 2025-09-22 23:07:20 GMT"
+ "text" : "Click the columns to drilldown the language breakdown. Last updated at 2025-09-22 23:21:00 GMT"
},
"title" : {
"text" : "The Weekly Challenge Language"
diff --git a/stats/pwc-language-breakdown-2020.json b/stats/pwc-language-breakdown-2020.json
index 9d0dc31b00..016a01c644 100644
--- a/stats/pwc-language-breakdown-2020.json
+++ b/stats/pwc-language-breakdown-2020.json
@@ -1223,7 +1223,7 @@
}
],
"subtitle" : {
- "text" : "Click the columns to drilldown the language breakdown. Last updated at 2025-09-22 23:07:20 GMT"
+ "text" : "Click the columns to drilldown the language breakdown. Last updated at 2025-09-22 23:21:00 GMT"
},
"title" : {
"text" : "The Weekly Challenge Language"
diff --git a/stats/pwc-language-breakdown-2021.json b/stats/pwc-language-breakdown-2021.json
index 4f9e4b4f7b..281784bbdb 100644
--- a/stats/pwc-language-breakdown-2021.json
+++ b/stats/pwc-language-breakdown-2021.json
@@ -1223,7 +1223,7 @@
}
],
"subtitle" : {
- "text" : "Click the columns to drilldown the language breakdown. Last updated at 2025-09-22 23:07:20 GMT"
+ "text" : "Click the columns to drilldown the language breakdown. Last updated at 2025-09-22 23:21:00 GMT"
},
"title" : {
"text" : "The Weekly Challenge Language"
diff --git a/stats/pwc-language-breakdown-2022.json b/stats/pwc-language-breakdown-2022.json
index 5707c59da8..e2063f9a4c 100644
--- a/stats/pwc-language-breakdown-2022.json
+++ b/stats/pwc-language-breakdown-2022.json
@@ -1223,7 +1223,7 @@
}
],
"subtitle" : {
- "text" : "Click the columns to drilldown the language breakdown. Last updated at 2025-09-22 23:07:20 GMT"
+ "text" : "Click the columns to drilldown the language breakdown. Last updated at 2025-09-22 23:21:00 GMT"
},
"title" : {
"text" : "The Weekly Challenge Language"
diff --git a/stats/pwc-language-breakdown-2023.json b/stats/pwc-language-breakdown-2023.json
index 8a88b443b3..58fdc66817 100644
--- a/stats/pwc-language-breakdown-2023.json
+++ b/stats/pwc-language-breakdown-2023.json
@@ -1200,7 +1200,7 @@
}
],
"subtitle" : {
- "text" : "Click the columns to drilldown the language breakdown. Last updated at 2025-09-22 23:07:20 GMT"
+ "text" : "Click the columns to drilldown the language breakdown. Last updated at 2025-09-22 23:21:00 GMT"
},
"title" : {
"text" : "The Weekly Challenge Language"
diff --git a/stats/pwc-language-breakdown-2024.json b/stats/pwc-language-breakdown-2024.json
index eb21b79719..c94c52c6f1 100644
--- a/stats/pwc-language-breakdown-2024.json
+++ b/stats/pwc-language-breakdown-2024.json
@@ -1246,7 +1246,7 @@
}
],
"subtitle" : {
- "text" : "Click the columns to drilldown the language breakdown. Last updated at 2025-09-22 23:07:20 GMT"
+ "text" : "Click the columns to drilldown the language breakdown. Last updated at 2025-09-22 23:21:00 GMT"
},
"title" : {
"text" : "The Weekly Challenge Language"
diff --git a/stats/pwc-language-breakdown-2025.json b/stats/pwc-language-breakdown-2025.json
index 3a73acf172..87f530f04d 100644
--- a/stats/pwc-language-breakdown-2025.json
+++ b/stats/pwc-language-breakdown-2025.json
@@ -8,7 +8,7 @@
"data" : [
[
"Perl",
- 22
+ 23
],
[
"Raku",
@@ -709,7 +709,7 @@
{
"drilldown" : "340",
"name" : "340",
- "y" : 36
+ "y" : 37
},
{
"drilldown" : "339",
@@ -901,7 +901,7 @@
}
],
"subtitle" : {
- "text" : "Click the columns to drilldown the language breakdown. Last updated at 2025-09-22 23:07:20 GMT"
+ "text" : "Click the columns to drilldown the language breakdown. Last updated at 2025-09-22 23:21:00 GMT"
},
"title" : {
"text" : "The Weekly Challenge Language"
diff --git a/stats/pwc-language-breakdown-summary.json b/stats/pwc-language-breakdown-summary.json
index b35feccbcb..3fb1bb3a4c 100644
--- a/stats/pwc-language-breakdown-summary.json
+++ b/stats/pwc-language-breakdown-summary.json
@@ -10,7 +10,7 @@
"data" : [
[
"Perl",
- 17506
+ 17507
],
[
"Raku",
@@ -37,7 +37,7 @@
}
],
"subtitle" : {
- "text" : "Last updated at 2025-09-22 23:07:20 GMT"
+ "text" : "Last updated at 2025-09-22 23:21:00 GMT"
},
"title" : {
"text" : "The Weekly Challenge Contributions [2019 - 2025]"
diff --git a/stats/pwc-leaders.json b/stats/pwc-leaders.json
index 5fd463a1b7..47122c031d 100644
--- a/stats/pwc-leaders.json
+++ b/stats/pwc-leaders.json
@@ -480,7 +480,7 @@
"data" : [
[
"Perl",
- 172
+ 173
],
[
"Raku",
@@ -947,7 +947,7 @@
{
"drilldown" : "Mohammad Sajid Anwar",
"name" : "31: Mohammad Sajid Anwar",
- "y" : 720
+ "y" : 722
},
{
"drilldown" : "Wanderdoc",
@@ -1049,7 +1049,7 @@
}
],
"subtitle" : {
- "text" : "Click the columns to drilldown the score breakdown. Last updated at 2025-09-22 23:07:20 GMT"
+ "text" : "Click the columns to drilldown the score breakdown. Last updated at 2025-09-22 23:21:00 GMT"
},
"title" : {
"text" : "Team Leaders (TOP 50)"
diff --git a/stats/pwc-summary-1-30.json b/stats/pwc-summary-1-30.json
index 7736f01614..4dbe4145e5 100644
--- a/stats/pwc-summary-1-30.json
+++ b/stats/pwc-summary-1-30.json
@@ -115,7 +115,7 @@
}
],
"subtitle" : {
- "text" : "[Champions: 30] Last updated at 2025-09-22 23:07:20 GMT"
+ "text" : "[Champions: 30] Last updated at 2025-09-22 23:21:00 GMT"
},
"title" : {
"text" : "The Weekly Challenge [2019 - 2025]"
diff --git a/stats/pwc-summary-121-150.json b/stats/pwc-summary-121-150.json
index d5db4730fc..74f4915a96 100644
--- a/stats/pwc-summary-121-150.json
+++ b/stats/pwc-summary-121-150.json
@@ -115,7 +115,7 @@
}
],
"subtitle" : {
- "text" : "[Champions: 30] Last updated at 2025-09-22 23:07:20 GMT"
+ "text" : "[Champions: 30] Last updated at 2025-09-22 23:21:00 GMT"
},
"title" : {
"text" : "The Weekly Challenge [2019 - 2025]"
diff --git a/stats/pwc-summary-151-180.json b/stats/pwc-summary-151-180.json
index 8189b40956..1415caecfc 100644
--- a/stats/pwc-summary-151-180.json
+++ b/stats/pwc-summary-151-180.json
@@ -115,7 +115,7 @@
}
],
"subtitle" : {
- "text" : "[Champions: 30] Last updated at 2025-09-22 23:07:20 GMT"
+ "text" : "[Champions: 30] Last updated at 2025-09-22 23:21:00 GMT"
},
"title" : {
"text" : "The Weekly Challenge [2019 - 2025]"
diff --git a/stats/pwc-summary-181-210.json b/stats/pwc-summary-181-210.json
index 2ab81a437b..77e48d7507 100644
--- a/stats/pwc-summary-181-210.json
+++ b/stats/pwc-summary-181-210.json
@@ -28,7 +28,7 @@
0,
0,
1,
- 172,
+ 173,
0,
0,
40,
@@ -115,7 +115,7 @@
}
],
"subtitle" : {
- "text" : "[Champions: 30] Last updated at 2025-09-22 23:07:20 GMT"
+ "text" : "[Champions: 30] Last updated at 2025-09-22 23:21:00 GMT"
},
"title" : {
"text" : "The Weekly Challenge [2019 - 2025]"
diff --git a/stats/pwc-summary-211-240.json b/stats/pwc-summary-211-240.json
index 1152bcdfb9..b5fc9d95c5 100644
--- a/stats/pwc-summary-211-240.json
+++ b/stats/pwc-summary-211-240.json
@@ -115,7 +115,7 @@
}
],
"subtitle" : {
- "text" : "[Champions: 30] Last updated at 2025-09-22 23:07:20 GMT"
+ "text" : "[Champions: 30] Last updated at 2025-09-22 23:21:00 GMT"
},
"title" : {
"text" : "The Weekly Challenge [2019 - 2025]"
diff --git a/stats/pwc-summary-241-270.json b/stats/pwc-summary-241-270.json
index 21f058bd80..d8bc445cf9 100644
--- a/stats/pwc-summary-241-270.json
+++ b/stats/pwc-summary-241-270.json
@@ -115,7 +115,7 @@
}
],
"subtitle" : {
- "text" : "[Champions: 30] Last updated at 2025-09-22 23:07:20 GMT"
+ "text" : "[Champions: 30] Last updated at 2025-09-22 23:21:00 GMT"
},
"title" : {
"text" : "The Weekly Challenge [2019 - 2025]"
diff --git a/stats/pwc-summary-271-300.json b/stats/pwc-summary-271-300.json
index 688eb446bd..d88b89fe39 100644
--- a/stats/pwc-summary-271-300.json
+++ b/stats/pwc-summary-271-300.json
@@ -115,7 +115,7 @@
}
],
"subtitle" : {
- "text" : "[Champions: 30] Last updated at 2025-09-22 23:07:20 GMT"
+ "text" : "[Champions: 30] Last updated at 2025-09-22 23:21:00 GMT"
},
"title" : {
"text" : "The Weekly Challenge [2019 - 2025]"
diff --git a/stats/pwc-summary-301-330.json b/stats/pwc-summary-301-330.json
index 77acce8b0b..a8c1592339 100644
--- a/stats/pwc-summary-301-330.json
+++ b/stats/pwc-summary-301-330.json
@@ -109,7 +109,7 @@
}
],
"subtitle" : {
- "text" : "[Champions: 28] Last updated at 2025-09-22 23:07:20 GMT"
+ "text" : "[Champions: 28] Last updated at 2025-09-22 23:21:00 GMT"
},
"title" : {
"text" : "The Weekly Challenge [2019 - 2025]"
diff --git a/stats/pwc-summary-31-60.json b/stats/pwc-summary-31-60.json
index 3adcd4a1de..1d0f510772 100644
--- a/stats/pwc-summary-31-60.json
+++ b/stats/pwc-summary-31-60.json
@@ -69,8 +69,8 @@
9,
0,
0,
- 2,
17,
+ 2,
0,
194,
0,
@@ -115,7 +115,7 @@
}
],
"subtitle" : {
- "text" : "[Champions: 30] Last updated at 2025-09-22 23:07:20 GMT"
+ "text" : "[Champions: 30] Last updated at 2025-09-22 23:21:00 GMT"
},
"title" : {
"text" : "The Weekly Challenge [2019 - 2025]"
diff --git a/stats/pwc-summary-61-90.json b/stats/pwc-summary-61-90.json
index 957cb17925..2d49115a44 100644
--- a/stats/pwc-summary-61-90.json
+++ b/stats/pwc-summary-61-90.json
@@ -115,7 +115,7 @@
}
],
"subtitle" : {
- "text" : "[Champions: 30] Last updated at 2025-09-22 23:07:20 GMT"
+ "text" : "[Champions: 30] Last updated at 2025-09-22 23:21:00 GMT"
},
"title" : {
"text" : "The Weekly Challenge [2019 - 2025]"
diff --git a/stats/pwc-summary-91-120.json b/stats/pwc-summary-91-120.json
index 25c20c2a7f..01452b6247 100644
--- a/stats/pwc-summary-91-120.json
+++ b/stats/pwc-summary-91-120.json
@@ -115,7 +115,7 @@
}
],
"subtitle" : {
- "text" : "[Champions: 30] Last updated at 2025-09-22 23:07:20 GMT"
+ "text" : "[Champions: 30] Last updated at 2025-09-22 23:21:00 GMT"
},
"title" : {
"text" : "The Weekly Challenge [2019 - 2025]"
diff --git a/stats/pwc-summary.json b/stats/pwc-summary.json
index ef57db6c1d..bec0eb8813 100644
--- a/stats/pwc-summary.json
+++ b/stats/pwc-summary.json
@@ -208,7 +208,7 @@
0,
0,
1,
- 106,
+ 107,
0,
0,
20,
@@ -397,8 +397,8 @@
6,
0,
0,
- 9,
1,
+ 9,
0,
104,
0,
@@ -1009,7 +1009,7 @@
}
],
"subtitle" : {
- "text" : "[Champions: 328] Last updated at 2025-09-22 23:07:20 GMT"
+ "text" : "[Champions: 328] Last updated at 2025-09-22 23:21:00 GMT"
},
"title" : {
"text" : "The Weekly Challenge [2019 - 2025]"
diff --git a/stats/pwc-yearly-language-summary.json b/stats/pwc-yearly-language-summary.json
index 7f58cecb05..55b3a08007 100644
--- a/stats/pwc-yearly-language-summary.json
+++ b/stats/pwc-yearly-language-summary.json
@@ -8,7 +8,7 @@
"data" : [
[
"Perl",
- 1735
+ 1736
],
[
"Raku",
@@ -151,7 +151,7 @@
{
"drilldown" : "2025",
"name" : "2025",
- "y" : 3279
+ "y" : 3280
},
{
"drilldown" : "2024",
@@ -188,7 +188,7 @@
}
],
"subtitle" : {
- "text" : "Click the columns to drilldown the language breakdown. Last updated at 2025-09-22 23:07:20 GMT"
+ "text" : "Click the columns to drilldown the language breakdown. Last updated at 2025-09-22 23:21:00 GMT"
},
"title" : {
"text" : "The Weekly Challenge Language"