diff options
| author | Mohammad Sajid Anwar <mohammad.anwar@yahoo.com> | 2025-08-19 12:12:35 +0100 |
|---|---|---|
| committer | Mohammad Sajid Anwar <mohammad.anwar@yahoo.com> | 2025-08-19 12:12:35 +0100 |
| commit | 72115ca8dee469436857991c88d7002158725057 (patch) | |
| tree | 2df87ae4691a937a254afbf644c9e35fb9ae7a0b | |
| parent | 8927d878c6aa164b979634439ee01f92790cd64b (diff) | |
| download | perlweeklychallenge-club-72115ca8dee469436857991c88d7002158725057.tar.gz perlweeklychallenge-club-72115ca8dee469436857991c88d7002158725057.tar.bz2 perlweeklychallenge-club-72115ca8dee469436857991c88d7002158725057.zip | |
- Added solutions by Eric Cheung.
- Added solutions by Jan Krnavek.
- Added solutions by Andrew Shitov.
- Added solutions by Mark Anderson.
- Added solutions by E. Choroba.
- Added solutions by Simon Proctor.
- Added solutions by Andreas Mahnke.
- Added solutions by Feng Chang.
- Added solutions by PokGoPun.
- Added solutions by Wanderdoc.
- Added solutions by Thomas Kohler.
- Added solutions by Conor Hoekstra.
- Added solutions by Ali Moradi.
- Added solutions by W. Luis Mochan.
36 files changed, 844 insertions, 480 deletions
diff --git a/challenge-332/perlboy1967/perl/ch1.pl b/challenge-332/perlboy1967/perl/ch-1.pl index 0bdbeb7207..0bdbeb7207 100755 --- a/challenge-332/perlboy1967/perl/ch1.pl +++ b/challenge-332/perlboy1967/perl/ch-1.pl diff --git a/challenge-332/perlboy1967/perl/ch2.pl b/challenge-332/perlboy1967/perl/ch-2.pl index 66583498e5..66583498e5 100755 --- a/challenge-332/perlboy1967/perl/ch2.pl +++ b/challenge-332/perlboy1967/perl/ch-2.pl diff --git a/challenge-333/perlboy1967/perl/ch1.pl b/challenge-333/perlboy1967/perl/ch-1.pl index 7ce19716dc..7ce19716dc 100755 --- a/challenge-333/perlboy1967/perl/ch1.pl +++ b/challenge-333/perlboy1967/perl/ch-1.pl diff --git a/challenge-333/perlboy1967/perl/ch2.pl b/challenge-333/perlboy1967/perl/ch-2.pl index 82ba9107b6..82ba9107b6 100755 --- a/challenge-333/perlboy1967/perl/ch2.pl +++ b/challenge-333/perlboy1967/perl/ch-2.pl diff --git a/challenge-334/perlboy1967/perl/ch1.pl b/challenge-334/perlboy1967/perl/ch-1.pl index c2d7df67b9..c2d7df67b9 100755 --- a/challenge-334/perlboy1967/perl/ch1.pl +++ b/challenge-334/perlboy1967/perl/ch-1.pl diff --git a/challenge-334/perlboy1967/perl/ch2.pl b/challenge-334/perlboy1967/perl/ch-2.pl index 86a8dcbeb2..86a8dcbeb2 100755 --- a/challenge-334/perlboy1967/perl/ch2.pl +++ b/challenge-334/perlboy1967/perl/ch-2.pl diff --git a/challenge-335/eric-cheung/python/ch-1.py b/challenge-335/eric-cheung/python/ch-1.py new file mode 100755 index 0000000000..15e9cde07a --- /dev/null +++ b/challenge-335/eric-cheung/python/ch-1.py @@ -0,0 +1,25 @@ +
+## arrWords = ["bella", "label", "roller"] ## Example 1
+## arrWords = ["cool", "lock", "cook"] ## Example 2
+## arrWords = ["hello", "world", "pole"] ## Example 3
+## arrWords = ["abc", "def", "ghi"] ## Example 4
+arrWords = ["aab", "aac", "aaa"] ## Example 5
+
+arrOutput = []
+
+for charLoop in set(arrWords[0]):
+ bFound = True
+
+ for strLoop in arrWords[1:]:
+ if charLoop not in strLoop:
+ bFound = False
+ break
+
+ if not bFound:
+ continue
+
+ nCount = min([strLoop.count(charLoop) for strLoop in arrWords])
+
+ arrOutput = arrOutput + list(charLoop * nCount)
+
+print (arrOutput)
diff --git a/challenge-335/eric-cheung/python/ch-2.py b/challenge-335/eric-cheung/python/ch-2.py new file mode 100755 index 0000000000..2c3c9ea545 --- /dev/null +++ b/challenge-335/eric-cheung/python/ch-2.py @@ -0,0 +1,31 @@ +
+def PlayerWin(arrInput, nNumMove):
+ for nRow in range(3):
+ if len(set([arrInput[nRow][nCol] for nCol in range(3)])) == 1 and arrInput[nRow][nRow] in ["A", "B"]:
+ return arrInput[nRow][nRow]
+
+ for nCol in range(3):
+ if len(set([arrInput[nRow][nCol] for nRow in range(3)])) == 1 and arrInput[nCol][nCol] in ["A", "B"]:
+ return arrInput[nCol][nCol]
+
+ if len(set([arrInput[nMax][nMax] for nMax in range(3)])) == 1 and arrInput[1][1] in ["A", "B"]:
+ return arrInput[1][1]
+
+ if len(set([arrInput[nMax][2 - nMax] for nMax in range(3)])) == 1 and arrInput[1][1] in ["A", "B"]:
+ return arrInput[1][1]
+
+ return ("Draw" if nNumMove == 9 else "Pending")
+
+## arrMoves = [[0, 0], [2, 0], [1, 1], [2, 1], [2, 2]] ## Example 1
+## arrMoves = [[0, 0], [1, 1], [0, 1], [0, 2], [1, 0], [2, 0]] ## Example 2
+## arrMoves = [[0, 0], [1, 1], [2, 0], [1, 0], [1, 2], [2, 1], [0, 1], [0, 2], [2, 2]] ## Example 3
+## arrMoves = [[0, 0], [1, 1]] ## Example 4
+arrMoves = [[1, 1], [0, 0], [2, 2], [0, 1], [1, 0], [0, 2]] ## Example 5
+
+arrOutput = [["_", "_", "_"], ["_", "_", "_"], ["_", "_", "_"]]
+
+for nIndx, arrLoop in enumerate(arrMoves):
+ arrOutput[arrLoop[0]][arrLoop[1]] = ("A" if nIndx % 2 == 0 else "B")
+
+## print (arrOutput)
+print (PlayerWin(arrOutput, len(arrMoves)))
diff --git a/challenge-335/perlboy1967/perl/ch1.pl b/challenge-335/perlboy1967/perl/ch-1.pl index 84b2ae0fd4..84b2ae0fd4 100755 --- a/challenge-335/perlboy1967/perl/ch1.pl +++ b/challenge-335/perlboy1967/perl/ch-1.pl diff --git a/challenge-335/perlboy1967/perl/ch2.pl b/challenge-335/perlboy1967/perl/ch-2.pl index 8717eca5c3..8717eca5c3 100755 --- a/challenge-335/perlboy1967/perl/ch2.pl +++ b/challenge-335/perlboy1967/perl/ch-2.pl diff --git a/stats/pwc-challenge-332.json b/stats/pwc-challenge-332.json index 3903b86546..7a3585b0a8 100644 --- a/stats/pwc-challenge-332.json +++ b/stats/pwc-challenge-332.json @@ -245,6 +245,16 @@ [ "Perl", 2 + ] + ], + "id" : "Niels van Dijke", + "name" : "Niels van Dijke" + }, + { + "data" : [ + [ + "Perl", + 2 ], [ "Raku", @@ -543,6 +553,11 @@ "y" : 2 }, { + "drilldown" : "Niels van Dijke", + "name" : "Niels van Dijke", + "y" : 2 + }, + { "drilldown" : "Packy Anderson", "name" : "Packy Anderson", "y" : 5 @@ -617,7 +632,7 @@ } ], "subtitle" : { - "text" : "[Champions: 34] Last updated at 2025-08-10 23:39:12 GMT" + "text" : "[Champions: 35] Last updated at 2025-08-19 11:04:11 GMT" }, "title" : { "text" : "The Weekly Challenge - 332" diff --git a/stats/pwc-challenge-333.json b/stats/pwc-challenge-333.json index 09802125dd..d57e5bf286 100644 --- a/stats/pwc-challenge-333.json +++ b/stats/pwc-challenge-333.json @@ -269,6 +269,16 @@ [ "Perl", 2 + ] + ], + "id" : "Niels van Dijke", + "name" : "Niels van Dijke" + }, + { + "data" : [ + [ + "Perl", + 2 ], [ "Raku", @@ -563,6 +573,11 @@ "y" : 2 }, { + "drilldown" : "Niels van Dijke", + "name" : "Niels van Dijke", + "y" : 2 + }, + { "drilldown" : "Packy Anderson", "name" : "Packy Anderson", "y" : 5 @@ -632,7 +647,7 @@ } ], "subtitle" : { - "text" : "[Champions: 35] Last updated at 2025-08-12 12:31:10 GMT" + "text" : "[Champions: 36] Last updated at 2025-08-19 11:04:11 GMT" }, "title" : { "text" : "The Weekly Challenge - 333" diff --git a/stats/pwc-challenge-334.json b/stats/pwc-challenge-334.json new file mode 100644 index 0000000000..af43e5b614 --- /dev/null +++ b/stats/pwc-challenge-334.json @@ -0,0 +1,604 @@ +{ + "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", + 2 + ], + [ + "Raku", + 2 + ] + ], + "id" : "Athanasius", + "name" : "Athanasius" + }, + { + "data" : [ + [ + "Raku", + 1 + ] + ], + "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" : [ + [ + "Raku", + 2 + ] + ], + "id" : "Feng Chang", + "name" : "Feng Chang" + }, + { + "data" : [ + [ + "Raku", + 2 + ] + ], + "id" : "Humberto Massa", + "name" : "Humberto Massa" + }, + { + "data" : [ + [ + "Perl", + 2 + ], + [ + "Raku", + 2 + ], + [ + "Blog", + 1 + ] + ], + "id" : "Jaldhar H. Vyas", + "name" : "Jaldhar H. Vyas" + }, + { + "data" : [ + [ + "Raku", + 2 + ] + ], + "id" : "Jan Krnavek", + "name" : "Jan Krnavek" + }, + { + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 1 + ] + ], + "id" : "Jorg Sommrey", + "name" : "Jorg Sommrey" + }, + { + "data" : [ + [ + "Perl", + 2 + ] + ], + "id" : "Kjetil Skotheim", + "name" : "Kjetil Skotheim" + }, + { + "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" : [ + [ + "Raku", + 2 + ] + ], + "id" : "Robert Ransbottom", + "name" : "Robert Ransbottom" + }, + { + "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" + }, + { + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 1 + ] + ], + "id" : "Yitzchak Scott-Thoennes", + "name" : "Yitzchak Scott-Thoennes" + } + ] + }, + "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" : 4 + }, + { + "drilldown" : "BarrOff", + "name" : "BarrOff", + "y" : 1 + }, + { + "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" : "Feng Chang", + "name" : "Feng Chang", + "y" : 2 + }, + { + "drilldown" : "Humberto Massa", + "name" : "Humberto Massa", + "y" : 2 + }, + { + "drilldown" : "Jaldhar H. Vyas", + "name" : "Jaldhar H. Vyas", + "y" : 5 + }, + { + "drilldown" : "Jan Krnavek", + "name" : "Jan Krnavek", + "y" : 2 + }, + { + "drilldown" : "Jorg Sommrey", + "name" : "Jorg Sommrey", + "y" : 3 + }, + { + "drilldown" : "Kjetil Skotheim", + "name" : "Kjetil Skotheim", + "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" : "Robert Ransbottom", + "name" : "Robert Ransbottom", + "y" : 2 + }, + { + "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 + }, + { + "drilldown" : "Yitzchak Scott-Thoennes", + "name" : "Yitzchak Scott-Thoennes", + "y" : 3 + } + ], + "name" : "The Weekly Challenge - 334" + } + ], + "subtitle" : { + "text" : "[Champions: 32] Last updated at 2025-08-19 11:04:11 GMT" + }, + "title" : { + "text" : "The Weekly Challenge - 334" + }, + "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 c7ea51ac16..d06c6cb800 100644 --- a/stats/pwc-current.json +++ b/stats/pwc-current.json @@ -32,7 +32,7 @@ "data" : [ [ "Raku", - 2 + 1 ] ], "id" : "A |
