diff options
| author | Mohammad Sajid Anwar <mohammad.anwar@yahoo.com> | 2025-02-12 18:33:02 +0000 |
|---|---|---|
| committer | Mohammad Sajid Anwar <mohammad.anwar@yahoo.com> | 2025-02-12 18:33:02 +0000 |
| commit | 9868c13eb66ea8c7c43bebedfca0f30ca3f002dd (patch) | |
| tree | 867a001b44d5b342d192f1daec3b30a6d760fb08 | |
| parent | b811272c09f90dab40b587b8b700381d0a7e28cc (diff) | |
| download | perlweeklychallenge-club-9868c13eb66ea8c7c43bebedfca0f30ca3f002dd.tar.gz perlweeklychallenge-club-9868c13eb66ea8c7c43bebedfca0f30ca3f002dd.tar.bz2 perlweeklychallenge-club-9868c13eb66ea8c7c43bebedfca0f30ca3f002dd.zip | |
- Added solutions by Robert McIntosh.
- Added solutions by Richard Park.
- Added solutions by Andreas Mahnke.
- Added solutions by Lubos Kolouch.
- Added solutions by Steven Wilson.
- Added solutions by Peter Campbell Smith.
- Added solutions by Conor Hoekstra.
- Added solutions by Robbie Hatley.
33 files changed, 3237 insertions, 3074 deletions
diff --git a/challenge-308/conor-hoekstra/ch-1.bqn b/challenge-308/conor-hoekstra/bqn/ch-1.bqn index 2e986bd207..2e986bd207 100644 --- a/challenge-308/conor-hoekstra/ch-1.bqn +++ b/challenge-308/conor-hoekstra/bqn/ch-1.bqn diff --git a/challenge-308/conor-hoekstra/ch-2.bqn b/challenge-308/conor-hoekstra/bqn/ch-2.bqn index 695c1b53f3..695c1b53f3 100644 --- a/challenge-308/conor-hoekstra/ch-2.bqn +++ b/challenge-308/conor-hoekstra/bqn/ch-2.bqn diff --git a/challenge-308/richard-park/apl/CountCommon.aplf b/challenge-308/richard-park/apl/CountCommon.aplf new file mode 100644 index 0000000000..ac2d5a17e2 --- /dev/null +++ b/challenge-308/richard-park/apl/CountCommon.aplf @@ -0,0 +1,10 @@ + CountCommon←{ +⍝ Can be defined as the 2-train atop + CountCommon←≢∩ +⍝ Literally "count the intersection" +⍝ ≢ ∩ +⍝ Example +⍝ 'perl' 'weekly' 'challenge' (≢∩) 'raku' 'weekly' 'challenge' +⍝ 2 + ≢⍺∩⍵ + } diff --git a/challenge-308/richard-park/apl/DecodeXOR.aplf b/challenge-308/richard-park/apl/DecodeXOR.aplf new file mode 100644 index 0000000000..a2c2cb7b2b --- /dev/null +++ b/challenge-308/richard-park/apl/DecodeXOR.aplf @@ -0,0 +1,15 @@ + DecodeXOR←{ +⍝ ⍺: initial +⍝ ⍵: encoded sequence +⍝ ←: original array that produced ⍵ +⍝ ⍵ ← 2{2⊥≠/2⊥⍣¯1⊢⍵}/original + 0∊⍴⍵:⍺ + nxt←2⊥≠/2⊥⍣¯1⊢⍺,⊃⍵ + ⍺,nxt ∇ 1↓⍵ + +⍝ Examples: +⍝ 1 DecodeXOR 1 2 3 +⍝ 1 0 2 1 +⍝ 4 DecodeXOR 6 2 7 3 +⍝ 4 2 0 7 4 + } diff --git a/challenge-308/robert-mcintosh/blog.txt b/challenge-308/robert-mcintosh/blog.txt new file mode 100644 index 0000000000..e41850ae6d --- /dev/null +++ b/challenge-308/robert-mcintosh/blog.txt @@ -0,0 +1 @@ +https://dev.to/rcmcintosh/my-python-and-raku-language-solutions-to-task-1-count-common-from-the-weekly-challenge-308-3a2b diff --git a/challenge-308/robert-mcintosh/blog1.txt b/challenge-308/robert-mcintosh/blog1.txt new file mode 100644 index 0000000000..3b56b91d9b --- /dev/null +++ b/challenge-308/robert-mcintosh/blog1.txt @@ -0,0 +1 @@ +https://dev.to/rcmcintosh/my-python-language-solution-to-task-2-decode-xor-from-the-weekly-challenge-308-3a3i diff --git a/challenge-308/robert-mcintosh/python/ch-1.py b/challenge-308/robert-mcintosh/python/ch-1.py new file mode 100644 index 0000000000..4e746d6562 --- /dev/null +++ b/challenge-308/robert-mcintosh/python/ch-1.py @@ -0,0 +1,2 @@ +def count_common(str1: [str], str2: [str]) -> int: + return len(set(str1).intersection(set(str2))) diff --git a/challenge-308/robert-mcintosh/python/ch-2.py b/challenge-308/robert-mcintosh/python/ch-2.py new file mode 100644 index 0000000000..050fe8c30c --- /dev/null +++ b/challenge-308/robert-mcintosh/python/ch-2.py @@ -0,0 +1,8 @@ +def decode(encoded: list[int], initial: int) -> [int]: + original = [ + initial, + ] + for encoded_element in encoded: + original_element = original[-1] ^ encoded_element + original.append(original_element) + return original diff --git a/challenge-308/robert-mcintosh/raku/ch-1.raku b/challenge-308/robert-mcintosh/raku/ch-1.raku new file mode 100644 index 0000000000..a1f54bb29d --- /dev/null +++ b/challenge-308/robert-mcintosh/raku/ch-1.raku @@ -0,0 +1,5 @@ +sub count_common (@str1, @str2) { + my $set1 = set @str1; + my $set2 = set @str2; + return ($set1 (&) $set2).elems; +} diff --git a/stats/pwc-challenge-307.json b/stats/pwc-challenge-307.json index 194489719e..ce4bd5bb0f 100644 --- a/stats/pwc-challenge-307.json +++ b/stats/pwc-challenge-307.json @@ -1,165 +1,12 @@ { - "subtitle" : { - "text" : "[Champions: 25] Last updated at 2025-02-10 20:38:56 GMT" - }, - "xAxis" : { - "type" : "category" - }, - "tooltip" : { - "pointFormat" : "<span style='color:{point.color}'>{point.name}</span>: <b>{point.y:f}</b><br/>", - "followPointer" : 1, - "headerFormat" : "<span style='font-size:11px'>{series.name}</span><br/>" - }, - "title" : { - "text" : "The Weekly Challenge - 307" - }, "plotOptions" : { "series" : { + "borderWidth" : 0, "dataLabels" : { - "enabled" : 1, - "format" : "{point.y}" - }, - "borderWidth" : 0 - } - }, - "series" : [ - { - "colorByPoint" : 1, - "data" : [ - { - "name" : "Ali Moradi", - "y" : 3, - "drilldown" : "Ali Moradi" - }, - { - "drilldown" : "Andreas Mahnke", - "name" : "Andreas Mahnke", - "y" : 2 - }, - { - "drilldown" : "Arne Sommer", - "y" : 3, - "name" : "Arne Sommer" - }, - { - "y" : 4, - "name" : "Athanasius", - "drilldown" : "Athanasius" - }, - { - "name" : "BarrOff", - "y" : 2, - "drilldown" : "BarrOff" - }, - { - "drilldown" : "Bob Lied", - "name" : "Bob Lied", - "y" : 2 - }, - { - "name" : "Dave Jacoby", - "y" : 2, - "drilldown" : "Dave Jacoby" - }, - { - "y" : 2, - "name" : "David Ferrone", - "drilldown" : "David Ferrone" - }, - { - "y" : 2, - "name" : "E. Choroba", - "drilldown" : "E. Choroba" - }, - { - "name" : "Jaldhar H. Vyas", - "y" : 5, - "drilldown" : "Jaldhar H. Vyas" - }, - { - "drilldown" : "Jan Krnavek", - "name" : "Jan Krnavek", - "y" : 2 - }, - { - "y" : 3, - "name" : "Jorg Sommrey", - "drilldown" : "Jorg Sommrey" - }, - { - "drilldown" : "Lubos Kolouch", - "name" : "Lubos Kolouch", - "y" : 2 - }, - { - "drilldown" : "Mark Anderson", - "name" : "Mark Anderson", - "y" : 2 - }, - { - "y" : 3, - "name" : "Matthias Muth", - "drilldown" : "Matthias Muth" - }, - { - "drilldown" : "Peter Campbell Smith", - "y" : 3, - "name" : "Peter Campbell Smith" - }, - { - "drilldown" : "Peter Meszaros", - "y" : 2, - "name" : "Peter Meszaros" - }, - { - "y" : 2, - "name" : "Robert Ransbottom", - "drilldown" : "Robert Ransbottom" - }, - { - "name" : "Roger Bell_West", - "y" : 5, - "drilldown" : "Roger Bell_West" - }, - { - "name" : "Simon Green", - "y" : 3, - "drilldown" : "Simon Green" - }, - { - "name" : "Steven Wilson", - "y" : 2, - "drilldown" : "Steven Wilson" - }, - { - "name" : "Thomas Kohler", - "y" : 4, - "drilldown" : "Thomas Kohler" - }, - { - "y" : 4, - "name" : "Ulrich Rieke", - "drilldown" : "Ulrich Rieke" - }, - { - "drilldown" : "W. Luis Mochan", - "name" : "W. Luis Mochan", - "y" : 3 - }, - { - "drilldown" : "Wanderdoc", - "name" : "Wanderdoc", - "y" : 2 - } - ], - "name" : "The Weekly Challenge - 307" + "format" : "{point.y}", + "enabled" : 1 + } } - ], - "chart" : { - "type" : "column" - }, - "legend" : { - "enabled" : 0 }, "yAxis" : { "title" : { @@ -193,6 +40,7 @@ "id" : "Andreas Mahnke" }, { + "id" : "Arne Sommer", "name" : "Arne Sommer", "data" : [ [ @@ -203,11 +51,9 @@ "Blog", 1 ] - ], - "id" : "Arne Sommer" + ] }, { - "id" : "Athanasius", "name" : "Athanasius", "data" : [ [ @@ -218,46 +64,47 @@ "Raku", 2 ] - ] + ], + "id" : "Athanasius" }, { + "name" : "BarrOff", "data" : [ [ "Raku", 2 ] ], - "name" : "BarrOff", "id" : "BarrOff" }, { + "id" : "Bob Lied", "name" : "Bob Lied", "data" : [ [ "Perl", 2 ] - ], - "id" : "Bob Lied" + ] }, { - "id" : "Dave Jacoby", "name" : "Dave Jacoby", "data" : [ [ "Perl", 2 ] - ] + ], + "id" : "Dave Jacoby" }, { + "name" : "David Ferrone", "data" : [ [ "Perl", 2 ] ], - "name" : "David Ferrone", "id" : "David Ferrone" }, { @@ -271,6 +118,7 @@ ] }, { + "id" : "Jaldhar H. Vyas", "name" : "Jaldhar H. Vyas", "data" : [ [ @@ -285,20 +133,20 @@ "Blog", 1 ] - ], - "id" : "Jaldhar H. Vyas" + ] }, { - "name" : "Jan Krnavek", + "id" : "Jan Krnavek", "data" : [ [ "Raku", 2 ] ], - "id" : "Jan Krnavek" + "name" : "Jan Krnavek" }, { + "id" : "Jorg Sommrey", "data" : [ [ "Perl", @@ -309,31 +157,29 @@ 1 ] ], - "name" : "Jorg Sommrey", - "id" : "Jorg Sommrey" + "name" : "Jorg Sommrey" }, { + "id" : "Lubos Kolouch", "name" : "Lubos Kolouch", "data" : [ [ "Perl", 2 ] - ], - "id" : "Lubos Kolouch" + ] }, { + "id" : "Mark Anderson", + "name" : "Mark Anderson", "data" : [ [ "Raku", 2 ] - ], - "name" : "Mark Anderson", - "id" : "Mark Anderson" + ] }, { - "id" : "Matthias Muth", "name" : "Matthias Muth", "data" : [ [ @@ -344,10 +190,10 @@ "Blog", 1 ] - ] + ], + "id" : "Matthias Muth" }, { - "id" : "Peter Campbell Smith", "data" : [ [ "Perl", @@ -358,7 +204,8 @@ 1 ] ], - "name" : "Peter Campbell Smith" + "name" : "Peter Campbell Smith", + "id" : "Peter Campbell Smith" }, { "name" : "Peter Meszaros", @@ -371,16 +218,31 @@ "id" : "Peter Meszaros" }, { + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 1 + ] + ], + "name" : "Robbie Hatley", + "id" : "Robbie Hatley" + }, + { + "id" : "Robert Ransbottom", "name" : "Robert Ransbottom", "data" : [ [ "Raku", 2 ] - ], - "id" : "Robert Ransbottom" + ] }, { + "name" : "Roger Bell_West", "data" : [ [ "Perl", @@ -395,11 +257,10 @@ 1 ] ], - "name" : "Roger Bell_West", "id" : "Roger Bell_West" }, { - "name" : "Simon Green", + "id" : "Simon Green", "data" : [ [ "Perl", @@ -410,19 +271,20 @@ 1 ] ], - "id" : "Simon Green" + "name" : "Simon Green" }, { - "id" : "Steven Wilson", "name" : "Steven Wilson", "data" : [ [ "Perl", 2 ] - ] + ], + "id" : "Steven Wilson" }, { + "id" : "Thomas Kohler", "data" : [ [ "Perl", @@ -433,8 +295,7 @@ 2 ] ], - "name" : "Thomas Kohler", - "id" : "Thomas Kohler" + "name" : "Thomas Kohler" }, { "id" : "Ulrich Rieke", @@ -451,6 +312,8 @@ "name" : "Ulrich Rieke" }, { + "id" : "W. Luis Mochan", + "name" : "W. Luis Mochan", "data" : [ [ "Perl", @@ -460,9 +323,7 @@ "Blog", 1 ] - ], - "name" : "W. Luis Mochan", - "id" : "W. Luis Mochan" + ] }, { "data" : [ @@ -475,5 +336,163 @@ "id" : "Wanderdoc" } ] + }, + "tooltip" : { + "pointFormat" : "<span style='color:{point.color}'>{point.name}</span>: <b>{point.y:f}</b><br/>", + "followPointer" : 1, + "headerFormat" : "<span style='font-size:11px'>{series.name}</span><br/>" + }, + "title" : { + "text" : "The Weekly Challenge - 307" + }, + "series" : [ + { + "name" : "The Weekly Challenge - 307", + "data" : [ + { + "drilldown" : "Ali Moradi", + "y" : 3, + "name" : "Ali Moradi" + }, + { + "name" : "Andreas Mahnke", + "y" : 2, + "drilldown" : "Andreas Mahnke" + }, + { + "drilldown" : "Arne Sommer", + "y" : 3, + "name" : "Arne Sommer" + }, + { + "y" : 4, + "name" : "Athanasius", + "drilldown" : "Athanasius" + }, + { + "name" : "BarrOff", + "y" : 2, + "drilldown" : "BarrOff" + }, + { + "y" : 2, + "name" : "Bob Lied", + "drilldown" : "Bob Lied" + }, + { + "name" : "Dave Jacoby", + "y" : 2, + "drilldown" : "Dave Jacoby" + }, + { + "drilldown" : "David Ferrone", + "y" : 2, + "name" : "David Ferrone" + }, + { + "name" : "E. Choroba", + "y" : 2, + "drilldown" : "E. Choroba" + }, + { + "drilldown" : "Jaldhar H. Vyas", + "name" : "Jaldhar H. Vyas", + "y" : 5 + }, + { + "y" : 2, + "name" : "Jan Krnavek", + "drilldown" : "Jan Krnavek" + }, + { + "drilldown" : "Jorg Sommrey", + "y" : 3, + "name" : "Jorg Sommrey" + }, + { + "name" : "Lubos Kolouch", + "y" : 2, + "drilldown" : "Lubos Kolouch" + }, + { + "drilldown" : "Mark Anderson", + "name" : "Mark Anderson", + "y" : 2 + }, + { + "drilldown" : "Matthias Muth", + "name" : "Matthias Muth", + "y" : 3 + }, + { + "drilldown" : "Peter Campbell Smith", + "y" : 3, + "name" : "Peter Campbell Smith" + }, + { + "y" : 2, + "name" : "Peter Meszaros", + "drilldown" : "Peter Meszaros" + }, + { + "name" : "Robbie Hatley", + "y" : 3, + "drilldown" : "Robbie Hatley" + }, + { + "name" : "Robert Ransbottom", + "y" : 2, + "drilldown" : "Robert Ransbottom" + }, + { + "y" : 5, + "name" : "Roger Bell_West", + "drilldown" : "Roger Bell_West" + }, + { + "name" : "Simon Green", + "y" : 3, + "drilldown" : "Simon Green" + }, + { + "name" : "Steven Wilson", + "y" : 2, + "drilldown" : "Steven Wilson" + }, + { + "drilldown" : "Thomas Kohler", + "name" : "Thomas Kohler", + "y" : 4 + }, + { + "drilldown" : "Ulrich Rieke", + "name" : "Ulrich Rieke", + "y" : 4 + }, + { + "name" : "W. Luis Mochan", + "y" : 3, + "drilldown" : "W. Luis Mochan" + }, + { + "y" : 2, + "name" : "Wanderdoc", + "drilldown" : "Wanderdoc" + } + ], + "colorByPoint" : 1 + } + ], + "xAxis" : { + "type" : "category" + }, + "chart" : { + "type" : "column" + }, + "legend" : { + "enabled" : 0 + }, + "subtitle" : { + "text" : "[Champions: 26] Last updated at 2025-02-12 18:32:44 GMT" } } diff --git a/stats/pwc-current.json b/stats/pwc-current.json index 980ce16702..644cac123a 100644 --- a/stats/pwc-current.json +++ b/stats/pwc-current.json @@ -1,96 +1,112 @@ { + "tooltip" : { + "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/>", + "followPointer" : 1 + }, + "subtitle" : { + "text" : "[Champions: 16] Last updated at 2025-02-12 18:32:47 GMT" + }, + "chart" : { + "type" : "column" + }, "series" : [ { - "colorByPoint" : 1, "name" : "The Weekly Challenge - 308", + "colorByPoint" : 1, "data" : [ { + "y" : 3, "name" : "Ali Moradi", - "drilldown" : "Ali Moradi", - "y" : 3 + "drilldown" : "Ali Moradi" + }, + { + "drilldown" : "Andreas Mahnke", + "name" : "Andreas Mahnke", + "y" : 2 }, { + "drilldown" : "David Ferrone", "name" : "David Ferrone", - "y" : 2, - "drilldown" : "David Ferrone" + "y" : 2 }, { - "y" : 2, "drilldown" : "E. Choroba", + "y" : 2, "name" : "E. Choroba" }, { - "name" : "Mark Anderson", - "drilldown" : "Mark Anderson", - "y" : 2 + "name" : "Lubos Kolouch", + "y" : 2, + "drilldown" : "Lubos Kolouch" }, { "y" : 2, + "name" : "Mark Anderson", + "drilldown" : "Mark Anderson" + }, + { "drilldown" : "Niels van Dijke", - "name" : "Niels van Dijke" + "name" : "Niels van Dijke", + "y" : 2 + }, + { + "drilldown" : "Peter Campbell Smith", + "y" : 3, + "name" : "Peter Campbell Smith" }, { "name" : "Peter Meszaros", - "drilldown" : "Peter Meszaros", - "y" : 2 + "y" : 2, + "drilldown" : "Peter Meszaros" + }, + { + "y" : 3, + "name" : "Robbie Hatley", + "drilldown" : "Robbie Hatley" + }, + { + "y" : 3, + "name" : "Robert McIntosh", + "drilldown" : "Robert McIntosh" }, { "name" : "Roger Bell_West", - "drilldown" : "Roger Bell_West", - "y" : 4 + "y" : 4, + "drilldown" : "Roger Bell_West" + }, + { + "name" : "Steven Wilson", + "y" : 2, + "drilldown" : "Steven Wilson" }, { "name" : "Thomas Kohler", - "drilldown" : "Thomas Kohler", - "y" : 4 + "y" : 4, + "drilldown" : "Thomas Kohler" }, { + "y" : 4, "name" : "Ulrich Rieke", - "drilldown" : "Ulrich Rieke", - "y" : 4 + "drilldown" : "Ulrich Rieke" }, { - "y" : 3, "drilldown" : "W. Luis Mochan", + "y" : 3, "name" : "W. Luis Mochan" } ] } ], - "subtitle" : { - "text" : "[Champions: 10] Last updated at 2025-02-11 11:18:59 GMT" + "title" : { + "text" : "The Weekly Challenge - 308" }, "legend" : { "enabled" : 0 }, - "chart" : { - "type" : "column" - }, - "plotOptions" : { - "series" : { - "dataLabels" : { - "enabled" : 1, - "format" : "{point.y}" - }, - "borderWidth" : 0 - } - }, - "title" : { - "text" : "The Weekly Challenge - 308" - }, "xAxis" : { "type" : "category" }, - "yAxis" : { - "title" : { - |
