aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohammad S Anwar <mohammad.anwar@yahoo.com>2023-09-04 01:30:04 +0100
committerMohammad S Anwar <mohammad.anwar@yahoo.com>2023-09-04 01:30:04 +0100
commit011f5753333c8e103396ef17683e2d7bb4164820 (patch)
treef89af44fe1f15bbd676a091aa44f53a8f16b912e
parent9b946478f8f6a7becaaad4a14dd31af0fb48de90 (diff)
downloadperlweeklychallenge-club-011f5753333c8e103396ef17683e2d7bb4164820.tar.gz
perlweeklychallenge-club-011f5753333c8e103396ef17683e2d7bb4164820.tar.bz2
perlweeklychallenge-club-011f5753333c8e103396ef17683e2d7bb4164820.zip
- Added solutions by Jan Krnavek.
- Added solutions by Mariano Spadaccini. - Added solutions by Tyler Wardhaugh. - Added solutions by Simon Green. - Added solutions by Lubos Kolouch. - Added solutions by Solathian. - Added solutions by Cheok-Yin Fung. - Added solutions by Matthias Muth. - Added solutions by Jorg Sommrey. - Added solutions by BarrOff. - Added solutions by Bruce Gray. - Added solutions by Kueppo Wesley. - Added solutions by Robert Ransbottom. - Added solutions by Bob Lied. - Added solutions by Feng Chang. - Added solutions by Clifton Wood. - Added solutions by Macy TY. - Added solutions by Wanderdoc.
-rw-r--r--challenge-231/clifton-wood/README1
-rw-r--r--challenge-231/clifton-wood/raku/ch-1.raku1
-rw-r--r--challenge-231/clifton-wood/raku/ch-2.raku3
-rw-r--r--challenge-231/clifton-wood/raku/ch-2a.raku3
-rw-r--r--challenge-231/kueppo-wesley/perl/ch-1.pl (renamed from challenge-231/kueppo-wesley/Perl/ch-1.pl)0
-rw-r--r--challenge-231/kueppo-wesley/perl/ch-2.pl (renamed from challenge-231/kueppo-wesley/Perl/ch-2.pl)0
-rw-r--r--challenge-231/macy-ty/README1
-rw-r--r--challenge-231/macy-ty/javascript/ch-1.js12
-rw-r--r--challenge-231/macy-ty/javascript/ch-2.js10
-rwxr-xr-xchallenge-231/wanderdoc/perl/ch-1.pl35
-rwxr-xr-xchallenge-231/wanderdoc/perl/ch-2.pl37
-rw-r--r--guests.json1
-rw-r--r--members.json1
-rw-r--r--stats/pwc-challenge-001.json510
-rw-r--r--stats/pwc-challenge-151.json228
-rw-r--r--stats/pwc-challenge-221.json267
-rw-r--r--stats/pwc-challenge-222.json295
-rw-r--r--stats/pwc-challenge-223.json267
-rw-r--r--stats/pwc-challenge-224.json267
-rw-r--r--stats/pwc-challenge-225.json573
-rw-r--r--stats/pwc-challenge-226.json341
-rw-r--r--stats/pwc-challenge-227.json297
-rw-r--r--stats/pwc-challenge-228.json583
-rw-r--r--stats/pwc-challenge-229.json587
-rw-r--r--stats/pwc-challenge-230.json603
-rw-r--r--stats/pwc-current.json462
-rw-r--r--stats/pwc-language-breakdown-summary.json54
-rw-r--r--stats/pwc-language-breakdown.json1580
-rw-r--r--stats/pwc-leaders.json500
-rw-r--r--stats/pwc-summary-1-30.json50
-rw-r--r--stats/pwc-summary-121-150.json114
-rw-r--r--stats/pwc-summary-151-180.json124
-rw-r--r--stats/pwc-summary-181-210.json98
-rw-r--r--stats/pwc-summary-211-240.json66
-rw-r--r--stats/pwc-summary-241-270.json114
-rw-r--r--stats/pwc-summary-271-300.json90
-rw-r--r--stats/pwc-summary-31-60.json116
-rw-r--r--stats/pwc-summary-61-90.json144
-rw-r--r--stats/pwc-summary-91-120.json66
-rw-r--r--stats/pwc-summary.json76
40 files changed, 4533 insertions, 4044 deletions
diff --git a/challenge-231/clifton-wood/README b/challenge-231/clifton-wood/README
new file mode 100644
index 0000000000..c85ee0de50
--- /dev/null
+++ b/challenge-231/clifton-wood/README
@@ -0,0 +1 @@
+Solutions by Clifton Wood.
diff --git a/challenge-231/clifton-wood/raku/ch-1.raku b/challenge-231/clifton-wood/raku/ch-1.raku
new file mode 100644
index 0000000000..369f845bf8
--- /dev/null
+++ b/challenge-231/clifton-wood/raku/ch-1.raku
@@ -0,0 +1 @@
+my @ints = (3, 2, 1, 4); @ints.grep( * != (@ints.min, @ints.max).any ).gist.say # (3 2)
diff --git a/challenge-231/clifton-wood/raku/ch-2.raku b/challenge-231/clifton-wood/raku/ch-2.raku
new file mode 100644
index 0000000000..1fb6657024
--- /dev/null
+++ b/challenge-231/clifton-wood/raku/ch-2.raku
@@ -0,0 +1,3 @@
+sub getAge($_) { .comb[11,12].join.Int };
+my @list = ("1313579440F2036","2921522980M5644");
+@list.grep({ .&getAge >= 60 }).elems.say # 0
diff --git a/challenge-231/clifton-wood/raku/ch-2a.raku b/challenge-231/clifton-wood/raku/ch-2a.raku
new file mode 100644
index 0000000000..93ea56cce2
--- /dev/null
+++ b/challenge-231/clifton-wood/raku/ch-2a.raku
@@ -0,0 +1,3 @@
+sub getAge($_) { .comb[11,12].join.Int };
+my @list = ("7868190130M7522","5303914400F9211","9273338290F4010");
+@list.grep({ .&getAge >= 60 }).elems.say # 2
diff --git a/challenge-231/kueppo-wesley/Perl/ch-1.pl b/challenge-231/kueppo-wesley/perl/ch-1.pl
index de61acb30d..de61acb30d 100644
--- a/challenge-231/kueppo-wesley/Perl/ch-1.pl
+++ b/challenge-231/kueppo-wesley/perl/ch-1.pl
diff --git a/challenge-231/kueppo-wesley/Perl/ch-2.pl b/challenge-231/kueppo-wesley/perl/ch-2.pl
index f34c48163d..f34c48163d 100644
--- a/challenge-231/kueppo-wesley/Perl/ch-2.pl
+++ b/challenge-231/kueppo-wesley/perl/ch-2.pl
diff --git a/challenge-231/macy-ty/README b/challenge-231/macy-ty/README
new file mode 100644
index 0000000000..bafec674e0
--- /dev/null
+++ b/challenge-231/macy-ty/README
@@ -0,0 +1 @@
+Solutions by Macy TY.
diff --git a/challenge-231/macy-ty/javascript/ch-1.js b/challenge-231/macy-ty/javascript/ch-1.js
new file mode 100644
index 0000000000..00db6b22e6
--- /dev/null
+++ b/challenge-231/macy-ty/javascript/ch-1.js
@@ -0,0 +1,12 @@
+function minMax (...elements){
+ let array = Object.values(elements);
+
+ const min_num = Math.min(...array);
+ const max_num = Math.max(...array);
+ var result = array.filter((num) => num != min_num && num != max_num);
+ if (result.length == 0){
+ result = -1;
+ }
+ console.log(result);
+}
+minMax(3, 1);
diff --git a/challenge-231/macy-ty/javascript/ch-2.js b/challenge-231/macy-ty/javascript/ch-2.js
new file mode 100644
index 0000000000..86827ee4f6
--- /dev/null
+++ b/challenge-231/macy-ty/javascript/ch-2.js
@@ -0,0 +1,10 @@
+function seniorCitizens (...elements){
+ var senior = 0;
+ for(value of elements){
+ const age = value.slice(-4, -2);
+ if (age >= 60){senior++}
+ }
+ console.log("Number of senior(s): " + senior);
+}
+
+seniorCitizens ("7868190130M7522","5303914400F9211","9273338290F4010")
diff --git a/challenge-231/wanderdoc/perl/ch-1.pl b/challenge-231/wanderdoc/perl/ch-1.pl
new file mode 100755
index 0000000000..747d84dd9d
--- /dev/null
+++ b/challenge-231/wanderdoc/perl/ch-1.pl
@@ -0,0 +1,35 @@
+#!perl
+use strict;
+use warnings FATAL => qw(all);
+
+=prompt
+You are given an array of distinct integers. Write a script to find all elements that is neither minimum nor maximum. Return -1 if you can’t.
+Example 1 Input: @ints = (3, 2, 1, 4) Output: (3, 2)
+The minimum is 1 and maximum is 4 in the given array. So (3, 2) is neither min nor max.
+Example 2 Input: @ints = (3, 1) Output: -1
+Example 3 Input: @ints = (2, 1, 3) Output: (2)
+The minimum is 1 and maximum is 3 in the given array. So 2 is neither min nor max.
+=cut
+
+
+
+use Test2::V0;
+use List::Util qw(min max);
+
+
+sub no_min_max
+{
+ my @arr = @_;
+ return -1 if (scalar @arr < 3);
+ my $min = min(@arr);
+ my $max = max(@arr);
+ @arr = grep {$_ != $min and $_ != $max} @arr;
+ return @arr;
+}
+
+# print join(" ", no_min_max(2, 1, 3));
+
+is([no_min_max(3, 2, 1, 4)], [3, 2], 'Example 1');
+is([no_min_max(3, 1)], [-1], 'Example 2');
+is([no_min_max(2, 1, 3)], [2], 'Example 3');
+done_testing(); \ No newline at end of file
diff --git a/challenge-231/wanderdoc/perl/ch-2.pl b/challenge-231/wanderdoc/perl/ch-2.pl
new file mode 100755
index 0000000000..90f2d33c3d
--- /dev/null
+++ b/challenge-231/wanderdoc/perl/ch-2.pl
@@ -0,0 +1,37 @@
+#!perl
+use strict;
+use warnings FATAL => qw(all);
+
+=prompt
+You are given a list of passenger details in the form "9999999999A1122", where 9 denotes the phone number, A the sex, 1 the age and 2 the seat number. Write a script to return the count of all senior citizens (age >= 60).
+Example 1 Input: @list = ("7868190130M7522","5303914400F9211","9273338290F4010") Output: 2
+The age of the passengers in the given list are 75, 92 and 40.
+So we have only 2 senior citizens.
+Example 2 Input: @list = ("1313579440F2036","2921522980M5644") Output: 0
+=cut
+
+
+
+
+
+
+
+use Test2::V0;
+
+sub count_by_age
+{
+ my $boundary = shift;
+ my @tickets = @_;
+ my $count = 0;
+ for my $elm ( @tickets )
+ {
+ my ($phone, $sex, $age, $seat) = unpack("A10A1A2A2", $elm);
+ $count++ if ( $age >= $boundary );
+ }
+ return $count;
+}
+
+
+is(count_by_age(60, ("7868190130M7522","5303914400F9211","9273338290F4010")), 2, 'Example 1');
+is(count_by_age(60, ("1313579440F2036","2921522980M5644")), 0, 'Example 2');
+done_testing(); \ No newline at end of file
diff --git a/guests.json b/guests.json
index 2beee277e4..de71c61efa 100644
--- a/guests.json
+++ b/guests.json
@@ -10,6 +10,7 @@
"henry-wong" : "Henry Wong",
"joaofel" : "Joao Felipe",
"karishma" : "Karishma Rajput",
+ "macy-ty" : "Macy TY",
"mfoda" : "Mohammad Foda",
"michael-dicicco" : "Michael DiCicco",
"orestis-zekai" : "Orestis Zekai",
diff --git a/members.json b/members.json
index ac47b24a06..e018ed16e7 100644
--- a/members.json
+++ b/members.json
@@ -47,6 +47,7 @@
"cheok-yin-fung" : "Cheok-Yin Fung",
"chicagoist" : "Chicagoist",
"christian-jaeger" : "Christian Jaeger",
+ "clifton-wood" : "Clifton Wood",
"cliveholloway" : "Clive Holloway",
"colin-crain" : "Colin Crain",
"craig" : "Craig",
diff --git a/stats/pwc-challenge-001.json b/stats/pwc-challenge-001.json
index 25538a0ae2..33459057a7 100644
--- a/stats/pwc-challenge-001.json
+++ b/stats/pwc-challenge-001.json
@@ -1,18 +1,17 @@
{
- "plotOptions" : {
- "series" : {
- "dataLabels" : {
- "format" : "{point.y}",
- "enabled" : 1
- },
- "borderWidth" : 0
- }
+ "title" : {
+ "text" : "The Weekly Challenge - 001"
},
"xAxis" : {
"type" : "category"
},
- "title" : {
- "text" : "The Weekly Challenge - 001"
+ "subtitle" : {
+ "text" : "[Champions: 69] Last updated at 2023-09-04 00:10:45 GMT"
+ },
+ "tooltip" : {
+ "headerFormat" : "<span style='font-size:11px'>{series.name}</span><br/>",
+ "followPointer" : 1,
+ "pointFormat" : "<span style='color:{point.color}'>{point.name}</span>: <b>{point.y:f}</b><br/>"
},
"chart" : {
"type" : "column"
@@ -22,12 +21,6 @@
"text" : "Total Solutions"
}
},
- "subtitle" : {
- "text" : "[Champions: 69] Last updated at 2023-03-26 10:37:55 GMT"
- },
- "legend" : {
- "enabled" : 0
- },
"drilldown" : {
"series" : [
{
@@ -41,6 +34,8 @@
]
},
{
+ "name" : "Adam Russell",
+ "id" : "Adam Russell",
"data" : [
[
"Perl",
@@ -50,29 +45,27 @@
"Blog",
1
]
- ],
- "id" : "Adam Russell",
- "name" : "Adam Russell"
+ ]
},
{
+ "name" : "Ailbhe Tweedie",
+ "id" : "Ailbhe Tweedie",
"data" : [
[
"Perl",
1
]
- ],
- "id" : "Ailbhe Tweedie",
- "name" : "Ailbhe Tweedie"
+ ]
},
{
- "id" : "Alex Daniel",
- "name" : "Alex Daniel",
"data" : [
[
"Raku",
2
]
- ]
+ ],
+ "name" : "Alex Daniel",
+ "id" : "Alex Daniel"
},
{
"id" : "Ali Moradi",
@@ -85,14 +78,14 @@
]
},
{
+ "name" : "Andrezgz",
+ "id" : "Andrezgz",
"data" : [
[
"Perl",
2
]
- ],
- "id" : "Andrezgz",
- "name" : "Andrezgz"
+ ]
},
{
"data" : [
@@ -105,8 +98,8 @@
"name" : "Antonio Gamiz"
},
{
- "name" : "Arne Sommer",
"id" : "Arne Sommer",
+ "name" : "Arne Sommer",
"data" : [
[
"Perl",
@@ -123,18 +116,18 @@
]
},
{
+ "id" : "Arpad Toth",
+ "name" : "Arpad Toth",
"data" : [
[
"Perl",
2
]
- ],
- "id" : "Arpad Toth",
- "name" : "Arpad Toth"
+ ]
},
{
- "name" : "Athanasius",
"id" : "Athanasius",
+ "name" : "Athanasius",
"data" : [
[
"Perl",
@@ -153,28 +146,26 @@
"id" : "Bob Kleemann"
},
{
+ "name" : "Bob Lied",
+ "id" : "Bob Lied",
"data" : [
[
"Perl",
2
]
- ],
- "name" : "Bob Lied",
- "id" : "Bob Lied"
+ ]
},
{
- "id" : "Daniel Mantovani",
- "name" : "Daniel Mantovani",
"data" : [
[
"Perl",
1
]
- ]
+ ],
+ "name" : "Daniel Mantovani",
+ "id" : "Daniel Mantovani"
},
{
- "name" : "Dave Cross",
- "id" : "Dave Cross",
"data" : [
[
"Perl",
@@ -184,7 +175,9 @@
"Blog",
1
]
- ]
+ ],
+ "id" : "Dave Cross",
+ "name" : "Dave Cross"
},
{
"id" : "Dave Jacoby",
@@ -201,14 +194,14 @@
]
},
{
- "id" : "David Kayal",
- "name" : "David Kayal",
"data" : [
[
"Perl",
2
]
- ]
+ ],
+ "name" : "David Kayal",
+ "id" : "David Kayal"
},
{
"data" : [
@@ -221,8 +214,8 @@
"id" : "Doug Schrag"
},
{
- "id" : "Duncan C. White",
"name" : "Duncan C. White",
+ "id" : "Duncan C. White",
"data" : [
[
"Perl",
@@ -231,24 +224,24 @@
]
},
{
- "name" : "Eddy HS",
- "id" : "Eddy HS",
"data" : [
[
"Perl",
2
]
- ]
+ ],
+ "name" : "Eddy HS",
+ "id" : "Eddy HS"
},
{
- "id" : "Finley",
- "name" : "Finley",
"data" : [
[
"Raku",
2
]
- ]
+ ],
+ "name" : "Finley",
+ "id" : "Finley"
},
{
"data" : [
@@ -257,18 +250,18 @@
1
]
],
- "id" : "Fred Zinn",
- "name" : "Fred Zinn"
+ "name" : "Fred Zinn",
+ "id" : "Fred Zinn"
},
{
- "id" : "Freddie B",
- "name" : "Freddie B",
"data" : [
[
"Perl",
2
]
- ]
+ ],
+ "id" : "Freddie B",
+ "name" : "Freddie B"
},
{
"name" : "Gustavo Chaves",
@@ -295,8 +288,8 @@
]
},
{
- "name" : "James Smith",
"id" : "James Smith",
+ "name" : "James Smith",
"data" : [
[
"Perl",
@@ -309,14 +302,14 @@
]
},
{
- "name" : "Jeff",
- "id" : "Jeff",
"data" : [
[
"Perl",
2
]
- ]
+ ],
+ "id" : "Jeff",
+ "name" : "Jeff"
},
{
"id" : "Jeremy Carman",
@@ -333,14 +326,14 @@
]
},
{
- "name" : "Jim Bacon",
- "id" : "Jim Bacon",
"data" : [
[
"Perl",
1
]
- ]
+ ],
+ "name" : "Jim Bacon",
+ "id" : "Jim Bacon"
},
{
"id" : "JJ Merelo",
@@ -357,6 +350,8 @@
]
},
{
+ "name" : "Jo Christian Oterhals",
+ "id" : "Jo Christian Oterhals",
"data" : [
[
"Perl",
@@ -370,13 +365,11 @@
"Blog",
1
]
- ],
- "name" : "Jo Christian Oterhals",
- "id" : "Jo Christian Oterhals"
+ ]
},
{
- "id" : "Joelle Maslak",
"name" : "Joelle Maslak",
+ "id" : "Joelle Maslak",
"data" : [
[
"Perl",
@@ -389,24 +382,24 @@
]
},
{
- "name" : "John Barrett",
- "id" : "John Barrett",
"data" : [
[
"Perl",
1
]
- ]
+ ],
+ "name" : "John Barrett",
+ "id" : "John Barrett"
},
{
- "name" : "Jorg Sommrey",
- "id" : "Jorg Sommrey",
"data" : [
[
"Perl",
2
]
- ]
+ ],
+ "name" : "Jorg Sommrey",
+ "id" : "Jorg Sommrey"
},
{
"data" : [
@@ -415,18 +408,18 @@
2
]
],
- "id" : "Juan Caballero",
- "name" : "Juan Caballero"
+ "name" : "Juan Caballero",
+ "id" : "Juan Caballero"
},
{
+ "id" : "Khalid",
+ "name" : "Khalid",
"data" : [
[
"Perl",
2
]
- ],
- "id" : "Khalid",
- "name" : "Khalid"
+ ]
},
{
"id" : "Kian-Meng Ang",
@@ -443,14 +436,14 @@
]
},
{
- "name" : "Kivanc Yazan",
- "id" : "Kivanc Yazan",
"data" : [
[
"Perl",
2
]
- ]
+ ],
+ "id" : "Kivanc Yazan",
+ "name" : "Kivanc Yazan"
},
{
"data" : [
@@ -477,6 +470,8 @@
"name" : "Lars Balker"
},
{
+ "id" : "Laurent Rosenfeld",
+ "name" : "Laurent Rosenfeld",
"data" : [
[
"Perl",
@@ -490,19 +485,21 @@
"Blog",
1
]
- ],
- "id" : "Laurent Rosenfeld",
- "name" : "Laurent Rosenfeld"
+ ]
},
{
+ "id" : "Lubos Kolouch",
+ "name" : "Lubos Kolouch",
"data" : [
[
"Perl",
2
+ ],
+ [
+ "Blog",
+ 1
]
- ],
- "id" : "Lubos Kolouch",
- "name" : "Lubos Kolouch"
+ ]
},
{
"data" : [
@@ -511,18 +508,18 @@
2
]
],
- "id" : "Mark Senn",
- "name" : "Mark Senn"
+ "name" : "Mark Senn",
+ "id" : "Mark Senn"
},
{
- "id" : "Martin Mugeni",
- "name" : "Martin Mugeni",
"data" : [
[
"Raku",
2
]
- ]
+ ],
+ "id" : "Martin Mugeni",
+ "name" : "Martin Mugeni"
},
{
"data" : [
@@ -531,22 +528,20 @@
2
]
],
- "name" : "Max Kossek",
- "id" : "Max Kossek"
+ "id" : "Max Kossek",
+ "name" : "Max Kossek"
},
{
- "id" : "Neil Bowers",
- "name" : "Neil Bowers",
"data" : [
[
"Perl",
1
]
- ]
+ ],
+ "id" : "Neil Bowers",
+ "name" : "Neil Bowers"
},
{
- "name" : "Nick Logan",
- "id" : "Nick Logan",
"data" : [
[
"Perl",
@@ -556,7 +551,9 @@
"Raku",
2
]
- ]
+ ],
+ "name" : "Nick Logan",
+ "id" : "Nick Logan"
},
{
"data" : [
@@ -565,8 +562,8 @@
2
]
],
- "id" : "Oleksii Tsvietnov",
- "name" : "Oleksii Tsvietnov"
+ "name" : "Oleksii Tsvietnov",
+ "id" : "Oleksii Tsvietnov"
},
{
"id" : "Ozzy",
@@ -579,34 +576,34 @@
]
},
{
- "id" : "Pablo Saavedra",
- "name" : "Pablo Saavedra",
"data" : [
[
"Perl",
2
]
- ]
+ ],
+ "name" : "Pablo Saavedra",
+ "id" : "Pablo Saavedra"
},
{
- "id" : "Paulo Custodio",
- "name" : "Paulo Custodio",
"data" : [
[
"Perl",
2
]
- ]
+ ],
+ "id" : "Paulo Custodio",
+ "name" : "Paulo Custodio"
},
{
- "id" : "Pavel Jurca",
- "name" : "Pavel Jurca",
"data" : [
[
"Perl",
2
]
- ]
+ ],
+ "name" : "Pavel Jurca",
+ "id" : "Pavel Jurca"
},
{
"id" : "Pete Houston",
@@ -629,12 +626,12 @@
1
]
],
- "id" : "Philippe Bruhat",
- "name" : "Philippe Bruhat"
+ "name" : "Philippe Bruhat",
+ "id" : "Philippe Bruhat"
},
{
- "id" : "Prajith P",
"name" : "Prajith P",
+ "id" : "Prajith P",
"data" : [
[
"Perl",
@@ -643,8 +640,8 @@
]
},
{
- "id" : "Ruben Westerberg",
"name" : "Ruben Westerberg",
+ "id" : "Ruben Westerberg",
"data" : [
[
"Perl",
@@ -657,6 +654,8 @@
]
},
{
+ "id" : "Ryan Thompson",
+ "name" : "Ryan Thompson",
"data" : [
[
"Perl",
@@ -666,33 +665,29 @@
"Raku",
2
]
- ],
- "id" : "Ryan Thompson",
- "name" : "Ryan Thompson"
+ ]