aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohammad Sajid Anwar <mohammad.anwar@yahoo.com>2025-09-15 10:03:56 +0100
committerMohammad Sajid Anwar <mohammad.anwar@yahoo.com>2025-09-15 10:03:56 +0100
commitb7dffbfb668d8ae3c7e9f77ef3c7da40d721da11 (patch)
tree319c7626392529ed543608745552f60a1375fc29
parent1f0dedba8efc34bb49b219ab9f5618eeea5c068b (diff)
downloadperlweeklychallenge-club-b7dffbfb668d8ae3c7e9f77ef3c7da40d721da11.tar.gz
perlweeklychallenge-club-b7dffbfb668d8ae3c7e9f77ef3c7da40d721da11.tar.bz2
perlweeklychallenge-club-b7dffbfb668d8ae3c7e9f77ef3c7da40d721da11.zip
- Added solutions by PokGoPun.
- Added solutions by Feng Chang. - Added solutions by Niels van Dijke. - Added solutions by Simon Proctor. - Added solutions by Mohammad Anwar.
-rw-r--r--challenge-339/mohammad-anwar/perl/ch-1.pl42
-rwxr-xr-xchallenge-339/perlboy1967/perl/ch-1.pl (renamed from challenge-339/perlboy1967/perl/ch1.pl)0
-rwxr-xr-xchallenge-339/perlboy1967/perl/ch-2.pl (renamed from challenge-339/perlboy1967/perl/ch2.pl)0
-rw-r--r--stats/pwc-challenge-338.json540
-rw-r--r--stats/pwc-current.json456
-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.json25
-rw-r--r--stats/pwc-language-breakdown-summary.json6
-rw-r--r--stats/pwc-leaders.json18
-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.json6
-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.json4
-rw-r--r--stats/pwc-summary-301-330.json2
-rw-r--r--stats/pwc-summary-31-60.json2
-rw-r--r--stats/pwc-summary-61-90.json4
-rw-r--r--stats/pwc-summary-91-120.json2
-rw-r--r--stats/pwc-summary.json12
-rw-r--r--stats/pwc-yearly-language-summary.json8
27 files changed, 661 insertions, 488 deletions
diff --git a/challenge-339/mohammad-anwar/perl/ch-1.pl b/challenge-339/mohammad-anwar/perl/ch-1.pl
new file mode 100644
index 0000000000..265579d0a8
--- /dev/null
+++ b/challenge-339/mohammad-anwar/perl/ch-1.pl
@@ -0,0 +1,42 @@
+#!/usr/bin/env perl
+
+use strict;
+use warnings;
+use Test::More;
+use List::Util qw/max/;
+
+sub max_diff {
+ my @nums = @_;
+
+ # For 4 elements, there are only 3 possible pairings
+ if (@nums == 4) {
+ my ($a, $b, $c, $d) = @nums;
+ return max(
+ $a*$b - $c*$d,
+ $a*$c - $b*$d,
+ $a*$d - $b*$c,
+ );
+ }
+
+ # For larger arrays, we need to consider extreme values
+ my @s = sort {$a <=> $b} @nums;
+
+ # The maximum difference will likely come from:
+ # Option 1: (two largest) vs (two smallest)
+ # Option 2: (largest*smallest) vs (second largest*second smallest)
+ # Option 3: (largest*second smallest) vs (second largest*smallest)
+
+ my $opt1 = $s[-1]*$s[-2] - $s[0]*$s[1];
+ my $opt2 = $s[-1]*$s[0] - $s[-2]*$s[1];
+ my $opt3 = $s[-1]*$s[1] - $s[-2]*$s[0];
+
+ return max($opt1, $opt2, $opt3);
+}
+
+is(max_diff(5,9,3,4,6), 42);
+is(max_diff(1,-2,3,-4), 10);
+is(max_diff(-3,-1,-2,-4), 10);
+is(max_diff(10,2,0,5,1), 50);
+is(max_diff(7,8,9,10,10), 44);
+
+done_testing;
diff --git a/challenge-339/perlboy1967/perl/ch1.pl b/challenge-339/perlboy1967/perl/ch-1.pl
index ed0a6212b0..ed0a6212b0 100755
--- a/challenge-339/perlboy1967/perl/ch1.pl
+++ b/challenge-339/perlboy1967/perl/ch-1.pl
diff --git a/challenge-339/perlboy1967/perl/ch2.pl b/challenge-339/perlboy1967/perl/ch-2.pl
index 63c29a8dc8..63c29a8dc8 100755
--- a/challenge-339/perlboy1967/perl/ch2.pl
+++ b/challenge-339/perlboy1967/perl/ch-2.pl
diff --git a/stats/pwc-challenge-338.json b/stats/pwc-challenge-338.json
new file mode 100644
index 0000000000..929e7ce76c
--- /dev/null
+++ b/stats/pwc-challenge-338.json
@@ -0,0 +1,540 @@
+{
+ "chart" : {
+ "type" : "column"
+ },
+ "drilldown" : {
+ "series" : [
+ {
+ "data" : [
+ [
+ "Perl",
+ 2
+ ],
+ [
+ "Blog",
+ 1
+ ]
+ ],
+ "id" : "Ali Moradi",
+ "name" : "Ali Moradi"
+ },
+ {
+ "data" : [
+ [
+ "Perl",
+ 2
+ ]
+ ],
+ "id" : "Andreas Mahnke",
+ "name" : "Andreas Mahnke"
+ },
+ {
+ "data" : [
+ [
+ "Raku",
+ 2
+ ]
+ ],
+ "id" : "Andrew Shitov",
+ "name" : "Andrew Shitov"
+ },
+ {
+ "data" : [
+ [
+ "Raku",
+ 2
+ ],
+ [
+ "Blog",
+ 1
+ ]
+ ],
+ "id" : "Arne Sommer",
+ "name" : "Arne Sommer"
+ },
+ {
+ "data" : [
+ [
+ "Perl",
+ 1
+ ],
+ [
+ "Raku",
+ 1
+ ]
+ ],
+ "id" : "Athanasius",
+ "name" : "Athanasius"
+ },
+ {
+ "data" : [
+ [
+ "Raku",
+ 2
+ ]
+ ],
+ "id" : "BarrOff",
+ "name" : "BarrOff"
+ },
+ {
+ "data" : [
+ [
+ "Perl",
+ 2
+ ],
+ [
+ "Blog",
+ 1
+ ]
+ ],
+ "id" : "Bob Lied",
+ "name" : "Bob Lied"
+ },
+ {
+ "data" : [
+ [
+ "Perl",
+ 2
+ ]
+ ],
+ "id" : "David Ferrone",
+ "name" : "David Ferrone"
+ },
+ {
+ "data" : [
+ [
+ "Perl",
+ 2
+ ]
+ ],
+ "id" : "E. Choroba",
+ "name" : "E. Choroba"
+ },
+ {
+ "data" : [
+ [
+ "Perl",
+ 2
+ ],
+ [
+ "Raku",
+ 2
+ ],
+ [
+ "Blog",
+ 1
+ ]
+ ],
+ "id" : "Jaldhar H. Vyas",
+ "name" : "Jaldhar H. Vyas"
+ },
+ {
+ "data" : [
+ [
+ "Perl",
+ 2
+ ],
+ [
+ "Blog",
+ 1
+ ]
+ ],
+ "id" : "Jorg Sommrey",
+ "name" : "Jorg Sommrey"
+ },
+ {
+ "data" : [
+ [
+ "Perl",
+ 2
+ ]
+ ],
+ "id" : "Kjetil Skotheim",
+ "name" : "Kjetil Skotheim"
+ },
+ {
+ "data" : [
+ [
+ "Perl",
+ 2
+ ]
+ ],
+ "id" : "Lubos Kolouch",
+ "name" : "Lubos Kolouch"
+ },
+ {
+ "data" : [
+ [
+ "Raku",
+ 2
+ ]
+ ],
+ "id" : "Mark Anderson",
+ "name" : "Mark Anderson"
+ },
+ {
+ "data" : [
+ [
+ "Perl",
+ 2
+ ]
+ ],
+ "id" : "Matthew Neleigh",
+ "name" : "Matthew Neleigh"
+ },
+ {
+ "data" : [
+ [
+ "Perl",
+ 2
+ ],
+ [
+ "Blog",
+ 1
+ ]
+ ],
+ "id" : "Matthias Muth",
+ "name" : "Matthias Muth"
+ },
+ {
+ "data" : [
+ [
+ "Perl",
+ 2
+ ]
+ ],
+ "id" : "Niels van Dijke",
+ "name" : "Niels van Dijke"
+ },
+ {
+ "data" : [
+ [
+ "Perl",
+ 2
+ ],
+ [
+ "Raku",
+ 2
+ ],
+ [
+ "Blog",
+ 1
+ ]
+ ],
+ "id" : "Packy Anderson",
+ "name" : "Packy Anderson"
+ },
+ {
+ "data" : [
+ [
+ "Perl",
+ 2
+ ],
+ [
+ "Blog",
+ 1
+ ]
+ ],
+ "id" : "Peter Campbell Smith",
+ "name" : "Peter Campbell Smith"
+ },
+ {
+ "data" : [
+ [
+ "Perl",
+ 2
+ ]
+ ],
+ "id" : "Peter Meszaros",
+ "name" : "Peter Meszaros"
+ },
+ {
+ "data" : [
+ [
+ "Perl",
+ 2
+ ],
+ [
+ "Blog",
+ 1
+ ]
+ ],
+ "id" : "Robbie Hatley",
+ "name" : "Robbie Hatley"
+ },
+ {
+ "data" : [
+ [
+ "Perl",
+ 2
+ ],
+ [
+ "Raku",
+ 2
+ ],
+ [
+ "Blog",
+ 1
+ ]
+ ],
+ "id" : "Roger Bell_West",
+ "name" : "Roger Bell_West"
+ },
+ {
+ "data" : [
+ [
+ "Perl",
+ 2
+ ],
+ [
+ "Blog",
+ 1
+ ]
+ ],
+ "id" : "Simon Green",
+ "name" : "Simon Green"
+ },
+ {
+ "data" : [
+ [
+ "Raku",
+ 2
+ ]
+ ],
+ "id" : "Simon Proctor",
+ "name" : "Simon Proctor"
+ },
+ {
+ "data" : [
+ [
+ "Perl",
+ 2
+ ],
+ [
+ "Blog",
+ 2
+ ]
+ ],
+ "id" : "Thomas Kohler",
+ "name" : "Thomas Kohler"
+ },
+ {
+ "data" : [
+ [
+ "Perl",
+ 2
+ ],
+ [
+ "Raku",
+ 2
+ ]
+ ],
+ "id" : "Ulrich Rieke",
+ "name" : "Ulrich Rieke"
+ },
+ {
+ "data" : [
+ [
+ "Perl",
+ 2
+ ],
+ [
+ "Blog",
+ 1
+ ]
+ ],
+ "id" : "W. Luis Mochan",
+ "name" : "W. Luis Mochan"
+ },
+ {
+ "data" : [
+ [
+ "Perl",
+ 2
+ ]
+ ],
+ "id" : "Wanderdoc",
+ "name" : "Wanderdoc"
+ }
+ ]
+ },
+ "legend" : {
+ "enabled" : 0
+ },
+ "plotOptions" : {
+ "series" : {
+ "borderWidth" : 0,
+ "dataLabels" : {
+ "enabled" : 1,
+ "format" : "{point.y}"
+ }
+ }
+ },
+ "series" : [
+ {
+ "colorByPoint" : 1,
+ "data" : [
+ {
+ "drilldown" : "Ali Moradi",
+ "name" : "Ali Moradi",
+ "y" : 3
+ },
+ {
+ "drilldown" : "Andreas Mahnke",
+ "name" : "Andreas Mahnke",
+ "y" : 2
+ },
+ {
+ "drilldown" : "Andrew Shitov",
+ "name" : "Andrew Shitov",
+ "y" : 2
+ },
+ {
+ "drilldown" : "Arne Sommer",
+ "name" : "Arne Sommer",
+ "y" : 3
+ },
+ {
+ "drilldown" : "Athanasius",
+ "name" : "Athanasius",
+ "y" : 2
+ },
+ {
+ "drilldown" : "BarrOff",
+ "name" : "BarrOff",
+ "y" : 2
+ },
+ {
+ "drilldown" : "Bob Lied",
+ "name" : "Bob Lied",
+ "y" : 3
+ },
+ {
+ "drilldown" : "David Ferrone",
+ "name" : "David Ferrone",
+ "y" : 2
+ },
+ {
+ "drilldown" : "E. Choroba",
+ "name" : "E. Choroba",
+ "y" : 2
+ },
+ {
+ "drilldown" : "Jaldhar H. Vyas",
+ "name" : "Jaldhar H. Vyas",
+ "y" : 5
+ },
+ {
+ "drilldown" : "Jorg Sommrey",
+ "name" : "Jorg Sommrey",
+ "y" : 3
+ },
+ {
+ "drilldown" : "Kjetil Skotheim",
+ "name" : "Kjetil Skotheim",
+ "y" : 2
+ },
+ {
+ "drilldown" : "Lubos Kolouch",
+ "name" : "Lubos Kolouch",
+ "y" : 2
+ },
+ {
+ "drilldown" : "Mark Anderson",
+ "name" : "Mark Anderson",
+ "y" : 2
+ },
+ {
+ "drilldown" : "Matthew Neleigh",
+ "name" : "Matthew Neleigh",
+ "y" : 2
+ },
+ {
+ "drilldown" : "Matthias Muth",
+ "name" : "Matthias Muth",
+ "y" : 3
+ },
+ {
+ "drilldown" : "Niels van Dijke",
+ "name" : "Niels van Dijke",
+ "y" : 2
+ },
+ {
+ "drilldown" : "Packy Anderson",
+ "name" : "Packy Anderson",
+ "y" : 5
+ },
+ {
+ "drilldown" : "Peter Campbell Smith",
+ "name" : "Peter Campbell Smith",
+ "y" : 3
+ },
+ {
+ "drilldown" : "Peter Meszaros",
+ "name" : "Peter Meszaros",
+ "y" : 2
+ },
+ {
+ "drilldown" : "Robbie Hatley",
+ "name" : "Robbie Hatley",
+ "y" : 3
+ },
+ {
+ "drilldown" : "Roger Bell_West",
+ "name" : "Roger Bell_West",
+ "y" : 5
+ },
+ {
+ "drilldown" : "Simon Green",
+ "name" : "Simon Green",
+ "y" : 3
+ },
+ {
+ "drilldown" : "Simon Proctor",
+ "name" : "Simon Proctor",
+ "y" : 2
+ },
+ {
+ "drilldown" : "Thomas Kohler",
+ "name" : "Thomas Kohler",
+ "y" : 4
+ },
+ {
+ "drilldown" : "Ulrich Rieke",
+ "name" : "Ulrich Rieke",
+ "y" : 4
+ },
+ {
+ "drilldown" : "W. Luis Mochan",
+ "name" : "W. Luis Mochan",
+ "y" : 3
+ },
+ {
+ "drilldown" : "Wanderdoc",
+ "name" : "Wanderdoc",
+ "y" : 2
+ }
+ ],
+ "name" : "The Weekly Challenge - 338"
+ }
+ ],
+ "subtitle" : {
+ "text" : "[Champions: 28] Last updated at 2025-09-15 09:03:38 GMT"
+ },
+ "title" : {
+ "text" : "The Weekly Challenge - 338"
+ },
+ "tooltip" : {
+ "followPointer" : 1,
+ "headerFormat" : "<span style='font-size:11px'>{series.name}</span><br/>",
+ "pointFormat" : "<span style='color:{point.color}'>{point.name}</span>: <b>{point.y:f}</b><br/>"
+ },
+ "xAxis" : {
+ "type" : "category"
+ },
+ "yAxis" : {
+ "title" : {
+ "text" : "Total Solutions"
+ }
+ }
+}
diff --git a/stats/pwc-current.json b/stats/pwc-current.json
index 746e776030..982ff805f4 100644
--- a/stats/pwc-current.json
+++ b/stats/pwc-current.json
@@ -7,194 +7,22 @@
{
"data" : [
[
- "Perl",
- 2
- ],
- [
- "Blog",
- 1
- ]
- ],
- "id" : "Ali Moradi",
- "name" : "Ali Moradi"
- },
- {
- "data" : [
- [
- "Perl",
- 2
- ]
- ],
- "id" : "Andreas Mahnke",
- "name" : "Andreas Mahnke"
- },
- {
- "data" : [
- [
- "Raku",
- 2
- ]
- ],
- "id" : "Andrew Shitov",
- "name" : "Andrew Shitov"
- },
- {
- "data" : [
- [
- "Raku",
- 2
- ],
- [
- "Blog",
- 1
- ]
- ],
- "id" : "Arne Sommer",
- "name" : "Arne Sommer"
- },
- {
- "data" : [
- [
- "Perl",
- 1
- ],
- [
- "Raku",
- 1
- ]
- ],
- "id" : "Athanasius",
- "name" : "Athanasius"
- },
- {
- "data" : [
- [
- "Raku",
- 2
- ]
- ],
- "id" : "BarrOff",
- "name" : "BarrOff"
- },
- {
- "data" : [
- [
- "Perl",
- 2
- ],
- [
- "Blog",
- 1
- ]
- ],
- "id" : "Bob Lied",
- "name" : "Bob Lied"
- },
- {
- "data" : [
- [
- "Perl",
- 2
- ]
- ],
- "id" : "David Ferrone",
- "name" : "David Ferrone"
- },
- {
- "data" : [
- [
- "Perl",
- 2
- ]
- ],
- "id" : "E. Choroba",
- "name" : "E. Choroba"
- },
- {
- "data" : [
- [
- "Perl",
- 2
- ],
- [
"Raku",
2
- ],
- [
- "Blog",
- 1
]
],
- "id" : "Jaldhar H. Vyas",
- "name" : "Jaldhar H. Vyas"
+ "id" : "Feng Chang",
+ "name" : "Feng Chang"
},
{
"data" : [
[
"Perl",
- 2
- ],
- [
- "Blog",
1
]
],
- "id" : "Jorg Sommrey",
- "name" : "Jorg Sommrey"
- },
- {
- "data" : [
- [
- "Perl",
- 2
- ]
- ],
- "id" : "Kjetil Skotheim",
- "name" : "Kjetil Skotheim"
- },
- {
- "data" : [
- [
- "Perl",
- 2
- ]
- ],
- "id" : "Lubos Kolouch",
- "name" : "Lubos Kolouch"
- },
- {
- "data" : [
- [
- "Raku",
- 2
- ]
- ],
- "id" : "Mark Anderson",
- "name" : "Mark Anderson"
- },
- {
- "data" : [
- [
- "Perl",
- 2
- ]
- ],
- "id" : "Matthew Neleigh",
- "name" : "Matthew Neleigh"
- },
- {
- "data" : [
- [
- "Perl",
- 2
- ],
- [
- "Blog",
- 1
- ]
- ],
- "id" : "Matthias Muth",
- "name" : "Matthias Muth"
+ "id" : "Mohammad Sajid Anwar",
+ "name" : "Mohammad Sajid Anwar"
},
{
"data" : [
@@ -209,152 +37,12 @@
{
"data" : [
[
- "Perl",
- 2
- ],
- [
- "Raku",
- 2
- ],
- [
- "Blog",
- 1
- ]
- ],
- "id" : "Packy Anderson",
- "name" : "Packy Anderson"
- },
- {
- "data" : [
- [
- "Perl",
- 2
- ],
- [
- "Blog",
- 1
- ]
- ],
- "id" : "Peter Campbell Smith",
- "name" : "Peter Campbell Smith"
- },
- {
- "data" : [
- [
- "Perl",
- 2
- ]
- ],
- "id" : "Peter Meszaros",
- "name" : "Peter Meszaros"
- },
- {
- "data" : [
- [
- "Perl",
- 2
- ],
- [
- "Blog",
- 1
- ]
- ],
- "id" : "Robbie Hatley",
- "name" : "Robbie Hatley"
- },
- {
- "data" : [
- [
- "Perl",
- 2
- ],
- [
- "Raku",
- 2
- ],
- [
- "Blog",
- 1
- ]
- ],
- "id" : "Roger Bell_West",
- "name" : "Roger Bell_West"
- },
- {
- "data" : [
- [
- "Perl",
- 2
- ],
- [
- "Blog",
- 1
- ]
- ],
- "id" : "Simon Green",
- "name" : "Simon Green"
- },
- {
- "data" : [
- [
"Raku",
2
]
],
"id" : "Simon Proctor",
"name" : "Simon Proctor"
- },
- {
- "data" : [
- [
- "Perl",
- 2
- ],
- [
- "Blog",
- 2
- ]
- ],
- "id" : "Thomas Kohler",
- "name" : "Thomas Kohler"
- },
- {
- "data" : [
- [
- "Perl",
- 2
- ],
- [
- "Raku",
- 2
- ]
- ],
- "id" : "Ulrich Rieke",
- "name" : "Ulrich Rieke"
- },
- {
- "data" : [
- [
- "Perl",
- 2
- ],
- [
- "Blog",
- 1
- ]
- ],
- "id" : "W. Luis Mochan",
- "name" : "W. Luis Mochan"
- },
- {
- "data" : [
- [
- "Perl",
- 2
- ]
- ],
- "id" : "Wanderdoc",
- "name" : "Wanderdoc"
}
]
},
@@ -375,84 +63,14 @@
"colorByPoint" : 1,
"data" : [
{
- "drilldown" : "Ali Moradi",
- "name" : "Ali Moradi",
- "y" : 3
- },
- {
- "drilldown" : "Andreas Mahnke",
- "name" : "Andreas Mahnke",
- "y" : 2
- },
- {
- "drilldown" : "Andrew Shitov",
- "name" : "Andrew Shitov",
+ "drilldown" : "Feng Chang",
+ "name" : "Feng Chang",
"y" : 2
},
{
- "drilldown" : "Arne Sommer",
- "name" : "Arne Sommer",
- "y" : 3
- },
- {
- "drilldown" : "Athanasius",
- "name" : "Athanasius",
- "y" : 2
- },
- {
- "drilldown" : "BarrOff",
- "name" : "BarrOff",
- "y" : 2
- },
- {
- "drilldown" : "Bob Lied",
- "name" : "Bob Lied",
- "y" : 3
- },
- {
- "drill