diff options
24 files changed, 2667 insertions, 2353 deletions
diff --git a/challenge-255/eric-cheung/python/ch-1.py b/challenge-255/eric-cheung/python/ch-1.py new file mode 100755 index 0000000000..fdd8032691 --- /dev/null +++ b/challenge-255/eric-cheung/python/ch-1.py @@ -0,0 +1,29 @@ +
+import sys
+
+## Example 1
+## strInput = "Perl"
+## strCheck = "Preel"
+
+## Example 2
+## strInput = "Weekly"
+## strCheck = "Weeakly"
+
+## Example 3
+strInput = "Box"
+strCheck = "Boxy"
+
+arrUniqCharInput = list(set(strInput))
+arrCharInputCount = [strInput.count(charLoop) for charLoop in arrUniqCharInput]
+
+arrUniqCharCheck = list(set(strCheck))
+arrUniqCheck = [strCheck.count(charLoop) for charLoop in arrUniqCharCheck]
+
+for nIndx, charLoop in enumerate(arrUniqCharCheck):
+ if charLoop not in arrUniqCharInput:
+ print (charLoop)
+ sys.exit()
+
+ if arrUniqCheck[nIndx] > arrCharInputCount[arrUniqCharInput.index(charLoop)]:
+ print (charLoop)
+ sys.exit()
diff --git a/challenge-255/eric-cheung/python/ch-2.py b/challenge-255/eric-cheung/python/ch-2.py new file mode 100755 index 0000000000..046fceb06e --- /dev/null +++ b/challenge-255/eric-cheung/python/ch-2.py @@ -0,0 +1,19 @@ +
+import numpy as np
+
+## Example 1
+## strPara = "Joe hit a ball, the hit ball flew far after it was hit."
+## strBan = "hit"
+
+## Example 2
+strPara = "Perl and Raku belong to the same family. Perl is the most popular language in the weekly challenge."
+strBan = "the"
+
+arrWordSet = strPara.replace(strBan, "").replace(",", "").replace(".", "").split()
+arrWordUniqSet = list(set(arrWordSet))
+arrWordCount = [arrWordSet.count(wordLoop) for wordLoop in arrWordUniqSet]
+
+## print (arrWordUniqSet)
+## print (arrWordCount)
+
+print (arrWordUniqSet[np.argmax(arrWordCount)])
diff --git a/challenge-255/laurent-rosenfeld/blog.txt b/challenge-255/laurent-rosenfeld/blog.txt new file mode 100644 index 0000000000..53e6daf89c --- /dev/null +++ b/challenge-255/laurent-rosenfeld/blog.txt @@ -0,0 +1 @@ +https://blogs.perl.org/users/laurent_r/2024/02/perl-weekly-challenge-255-odd-character.html diff --git a/challenge-255/laurent-rosenfeld/perl/ch-1.pl b/challenge-255/laurent-rosenfeld/perl/ch-1.pl new file mode 100644 index 0000000000..b8daf783a1 --- /dev/null +++ b/challenge-255/laurent-rosenfeld/perl/ch-1.pl @@ -0,0 +1,12 @@ +sub odd_char { + my (%s, %t); + %s = map { $_ => ++$s{$_} } split //, $_[0]; + %t = map { $_ => ++$t{$_} } split //, $_[1]; + my @result = grep { (not defined $s{$_}) + or $t{$_} - $s{$_} > 0 } keys %t; +} + +for my $test ([<Perl Preel>], [<Weekly Weeakly>], [<Box Boxy>]) { + printf "%-8s %-8s => ", @$test; + say odd_char $test->[0], $test->[1]; +} diff --git a/challenge-255/laurent-rosenfeld/raku/ch-1.raku b/challenge-255/laurent-rosenfeld/raku/ch-1.raku new file mode 100644 index 0000000000..bbd843dcd2 --- /dev/null +++ b/challenge-255/laurent-rosenfeld/raku/ch-1.raku @@ -0,0 +1,8 @@ +sub odd-char ($s, $t) { + return ~ ($t.comb.Bag (-) $s.comb.Bag); +} + +for <Perl Preel>, <Weekly Weeakly>, <Box Boxy> -> @test { + printf "%-8s %-8s => ", @test; + say odd-char @test[0], @test[1]; +} diff --git a/challenge-255/steven-wilson/python/ch-01.py b/challenge-255/steven-wilson/python/ch-1.py index dac2d858ab..dac2d858ab 100644 --- a/challenge-255/steven-wilson/python/ch-01.py +++ b/challenge-255/steven-wilson/python/ch-1.py diff --git a/challenge-255/steven-wilson/python/ch-02.py b/challenge-255/steven-wilson/python/ch-2.py index 2d5fc3ab9c..2d5fc3ab9c 100644 --- a/challenge-255/steven-wilson/python/ch-02.py +++ b/challenge-255/steven-wilson/python/ch-2.py diff --git a/stats/pwc-challenge-254.json b/stats/pwc-challenge-254.json new file mode 100644 index 0000000000..c1e1888da9 --- /dev/null +++ b/stats/pwc-challenge-254.json @@ -0,0 +1,624 @@ +{ + "chart" : { + "type" : "column" + }, + "yAxis" : { + "title" : { + "text" : "Total Solutions" + } + }, + "xAxis" : { + "type" : "category" + }, + "legend" : { + "enabled" : 0 + }, + "title" : { + "text" : "The Weekly Challenge - 254" + }, + "series" : [ + { + "name" : "The Weekly Challenge - 254", + "colorByPoint" : 1, + "data" : [ + { + "drilldown" : "Ali Moradi", + "y" : 3, + "name" : "Ali Moradi" + }, + { + "name" : "Arne Sommer", + "y" : 3, + "drilldown" : "Arne Sommer" + }, + { + "name" : "Athanasius", + "drilldown" : "Athanasius", + "y" : 4 + }, + { + "name" : "Bob Lied", + "drilldown" : "Bob Lied", + "y" : 3 + }, + { + "name" : "Bruce Gray", + "y" : 4, + "drilldown" : "Bruce Gray" + }, + { + "drilldown" : "Dave Jacoby", + "y" : 3, + "name" : "Dave Jacoby" + }, + { + "name" : "David Ferrone", + "drilldown" : "David Ferrone", + "y" : 2 + }, + { + "name" : "E. Choroba", + "y" : 2, + "drilldown" : "E. Choroba" + }, + { + "name" : "Humberto Massa", + "y" : 2, + "drilldown" : "Humberto Massa" + }, + { + "drilldown" : "Jaldhar H. Vyas", + "y" : 5, + "name" : "Jaldhar H. Vyas" + }, + { + "drilldown" : "Jan Krnavek", + "y" : 2, + "name" : "Jan Krnavek" + }, + { + "name" : "Jorg Sommrey", + "y" : 3, + "drilldown" : "Jorg Sommrey" + }, + { + "drilldown" : "Laurent Rosenfeld", + "y" : 6, + "name" : "Laurent Rosenfeld" + }, + { + "name" : "Lubos Kolouch", + "y" : 4, + "drilldown" : "Lubos Kolouch" + }, + { + "name" : "Luca Ferrari", + "y" : 11, + "drilldown" : "Luca Ferrari" + }, + { + "drilldown" : "Mark Anderson", + "y" : 2, + "name" : "Mark Anderson" + }, + { + "drilldown" : "Matthew Neleigh", + "y" : 2, + "name" : "Matthew Neleigh" + }, + { + "drilldown" : "Mustafa Aydin", + "y" : 2, + "name" : "Mustafa Aydin" + }, + { + "y" : 2, + "drilldown" : "Nelo Tovar", + "name" : "Nelo Tovar" + }, + { + "name" : "Niels van Dijke", + "drilldown" : "Niels van Dijke", + "y" : 2 + }, + { + "name" : "Packy Anderson", + "drilldown" : "Packy Anderson", + "y" : 5 + }, + { + "name" : "Peter Campbell Smith", + "y" : 3, + "drilldown" : "Peter Campbell Smith" + }, + { + "drilldown" : "Peter Meszaros", + "y" : 2, + "name" : "Peter Meszaros" + }, + { + "y" : 3, + "drilldown" : "Robbie Hatley", + "name" : "Robbie Hatley" + }, + { + "name" : "Robert Ransbottom", + "y" : 2, + "drilldown" : "Robert Ransbottom" + }, + { + "name" : "Roger Bell_West", + "y" : 5, + "drilldown" : "Roger Bell_West" + }, + { + "drilldown" : "Simon Green", + "y" : 3, + "name" : "Simon Green" + }, + { + "drilldown" : "Stephen G. Lynn", + "y" : 3, + "name" : "Stephen G. Lynn" + }, + { + "drilldown" : "Thomas Kohler", + "y" : 4, + "name" : "Thomas Kohler" + }, + { + "y" : 4, + "drilldown" : "Ulrich Rieke", + "name" : "Ulrich Rieke" + }, + { + "name" : "W. Luis Mochan", + "y" : 3, + "drilldown" : "W. Luis Mochan" + }, + { + "name" : "Wanderdoc", + "y" : 2, + "drilldown" : "Wanderdoc" + } + ] + } + ], + "subtitle" : { + "text" : "[Champions: 32] Last updated at 2024-02-05 19:18:08 GMT" + }, + "plotOptions" : { + "series" : { + "borderWidth" : 0, + "dataLabels" : { + "enabled" : 1, + "format" : "{point.y}" + } + } + }, + "drilldown" : { + "series" : [ + { + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 1 + ] + ], + "id" : "Ali Moradi", + "name" : "Ali Moradi" + }, + { + "data" : [ + [ + "Raku", + 2 + ], + [ + "Blog", + 1 + ] + ], + "name" : "Arne Sommer", + "id" : "Arne Sommer" + }, + { + "data" : [ + [ + "Perl", + 2 + ], + [ + "Raku", + 2 + ] + ], + "name" : "Athanasius", + "id" : "Athanasius" + }, + { + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 1 + ] + ], + "id" : "Bob Lied", + "name" : "Bob Lied" + }, + { + "data" : [ + [ + "Perl", + 2 + ], + [ + "Raku", + 2 + ] + ], + "id" : "Bruce Gray", + "name" : "Bruce Gray" + }, + { + "name" : "Dave Jacoby", + "id" : "Dave Jacoby", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 1 + ] + ] + }, + { + "name" : "David Ferrone", + "id" : "David Ferrone", + "data" : [ + [ + "Perl", + 2 + ] + ] + }, + { + "data" : [ + [ + "Perl", + 2 + ] + ], + "id" : "E. Choroba", + "name" : "E. Choroba" + }, + { + "name" : "Humberto Massa", + "id" : "Humberto Massa", + "data" : [ + [ + "Raku", + 2 + ] + ] + }, + { + "data" : [ + [ + "Perl", + 2 + ], + [ + "Raku", + 2 + ], + [ + "Blog", + 1 + ] + ], + "id" : "Jaldhar H. Vyas", + "name" : "Jaldhar H. Vyas" + }, + { + "data" : [ + [ + "Raku", + 2 + ] + ], + "id" : "Jan Krnavek", + "name" : "Jan Krnavek" + }, + { + "id" : "Jorg Sommrey", + "name" : "Jorg Sommrey", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 1 + ] + ] + }, + { + "id" : "Laurent Rosenfeld", + "name" : "Laurent Rosenfeld", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Raku", + 2 + ], + [ + "Blog", + 2 + ] + ] + }, + { + "data" : [ + [ + "Perl", + 2 + ], + [ + "Raku", + 2 + ] + ], + "id" : "Lubos Kolouch", + "name" : "Lubos Kolouch" + }, + { + "data" : [ + [ + "Raku", + 2 + ], + [ + "Blog", + 9 + ] + ], + "name" : "Luca Ferrari", + "id" : "Luca Ferrari" + }, + { + "data" : [ + [ + "Raku", + 2 + ] + ], + "name" : "Mark Anderson", + "id" : "Mark Anderson" + }, + { + "data" : [ + [ + "Perl", + 2 + ] + ], + "name" : "Matthew Neleigh", + "id" : "Matthew Neleigh" + }, + { + "data" : [ + [ + "Raku", + 2 + ] + ], + "name" : "Mustafa Aydin", + "id" : "Mustafa Aydin" + }, + { + "data" : [ + [ + "Perl", + 2 + ] + ], + "name" : "Nelo Tovar", + "id" : "Nelo Tovar" + }, + { + "data" : [ + [ + "Perl", + 2 + ] + ], + "name" : "Niels van Dijke", + "id" : "Niels van Dijke" + }, + { + "data" : [ + [ + "Perl", + 2 + ], + [ + "Raku", + 2 + ], + [ + "Blog", + 1 + ] + ], + "id" : "Packy Anderson", + "name" : "Packy Anderson" + }, + { + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 1 + ] + ], + "name" : "Peter Campbell Smith", + "id" : "Peter Campbell Smith" + }, + { + "id" : "Peter Meszaros", + "name" : "Peter Meszaros", + "data" : [ + [ + "Perl", + 2 + ] + ] + }, + { + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 1 + ] + ], + "name" : "Robbie Hatley", + "id" : "Robbie Hatley" + }, + { + "data" : [ + [ + "Raku", + 2 + ] + ], + "id" : "Robert Ransbottom", + "name" : "Robert Ransbottom" + }, + { + "data" : [ + [ + "Perl", + 2 + ], + [ + "Raku", + 2 + ], + [ + "Blog", + 1 + ] + ], + "name" : "Roger Bell_West", + "id" : "Roger Bell_West" + }, + { + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 1 + ] + ], + "id" : "Simon Green", + "name" : "Simon Green" + }, + { + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 1 + ] + ], + "name" : "Stephen G. Lynn", + "id" : "Stephen G. Lynn" + }, + { + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 2 + ] + ], + "name" : "Thomas Kohler", + "id" : "Thomas Kohler" + }, + { + "name" : "Ulrich Rieke", + "id" : "Ulrich Rieke", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Raku", + 2 + ] + ] + }, + { + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 1 + ] + ], + "name" : "W. Luis Mochan", + "id" : "W. Luis Mochan" + }, + { + "data" : [ + [ + "Perl", + 2 + ] + ], + "name" : "Wanderdoc", + "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/>" + } +} diff --git a/stats/pwc-current.json b/stats/pwc-current.json index 7b322bbc36..38fba30276 100644 --- a/stats/pwc-current.json +++ b/stats/pwc-current.json @@ -1,332 +1,86 @@ { - "xAxis" : { - "type" : "category" - }, - "chart" : { - "type" : "column" - }, - "legend" : { - "enabled" : 0 + "plotOptions" : { + "series" : { + "borderWidth" : 0, + "dataLabels" : { + "enabled" : 1, + "format" : "{point.y}" + } + } }, "drilldown" : { "series" : [ { - "data" : [ - [ - "Perl", - 2 - ], - [ - "Blog", - 1 - ] - ], - "id" : "Ali Moradi", - "name" : "Ali Moradi" - }, - { - "data" : [ - [ - "Raku", - 2 - ], - [ - "Blog", - 1 - ] - ], - "id" : "Arne Sommer", - "name" : "Arne Sommer" - }, - { - "name" : "Athanasius", - "id" : "Athanasius", - "data" : [ - [ - "Perl", - 2 - ], - [ - "Raku", - 2 - ] - ] - }, - { - "data" : [ - [ - "Perl", - 2 - ], - [ - "Blog", - 1 - ] - ], - "id" : "Bob Lied", - "name" : "Bob Lied" - }, - { - "data" : [ - [ - "Perl", - 2 - ], - [ - "Raku", - 2 - ] - ], - "name" : "Bruce Gray", - "id" : "Bruce Gray" - }, - { - "id" : "Dave Jacoby", - "name" : "Dave Jacoby", - "data" : [ - [ - "Perl", - 2 - ], - [ - "Blog", - 1 - ] - ] - }, - { - "data" : [ - [ - "Perl", - 2 - ] - ], "name" : "David Ferrone", - "id" : "David Ferrone" - }, - { + "id" : "David Ferrone", "data" : [ [ "Perl", 2 ] - ], - "id" : "E. Choroba", - "name" : "E. Choroba" - }, - { - "id" : "Humberto Massa", - "name" : "Humberto Massa", - "data" : [ - [ - "Raku", - 2 - ] ] }, { + "id" : "Laurent Rosenfeld", "data" : [ [ "Perl", - 2 + 1 ], [ "Raku", - 2 - ], - [ - "Blog", 1 - ] - ], - "name" : "Jaldhar H. Vyas", - "id" : "Jaldhar H. Vyas" - }, - { - "id" : "Jan Krnavek", - "name" : "Jan Krnavek", - "data" : [ - [ - "Raku", - 2 - ] - ] - }, - { - "data" : [ - [ - "Perl", - 2 ], [ "Blog", 1 ] ], - "id" : "Jorg Sommrey", - "name" : "Jorg Sommrey" + "name" : "Laurent Rosenfeld" }, { "data" : [ [ - "Perl", - 2 - ], - [ "Raku", 2 ], [ "Blog", - 2 + 9 ] ], - "name" : "Laurent Rosenfeld", - "id" : "Laurent Rosenfeld" - }, - { - "id" : "Lubos Kolouch", - "name" : "Lubos Kolouch", - "data" : [ - [ - "Perl", - 2 - ], - [ - "Raku", - 2 - ] - ] - }, - { - "name" : "Luca Ferrari", "id" : "Luca Ferrari", - "data" : [ - [ - "Raku", - 2 - ], - [ - "Blog", - 9 - ] - ] + "name" : "Luca Ferrari" }, { "id" : "Mark Anderson", - "name" : "Mark Anderson", "data" : [ [ "Raku", 2 ] - ] + ], + "name" : "Mark Anderson" }, { "id" : "Matthew Neleigh", - "name" : "Matthew Neleigh", "data" : [ [ "Perl", 2 ] - ] - }, - { - "data" : [ - [ - "Raku", - 2 - ] ], - "id" : "Mustafa Aydin", - "name" : "Mustafa Aydin" - }, - { - "id" : "Nelo Tovar", - "name" : "Nelo Tovar", - "data" : [ - [ - "Perl", - 2 - ] - ] - }, - { - "name" : "Niels van Dijke", - "id" : "Niels van Dijke", - "data" : [ - [ - "Perl", - 2 - ] - ] - }, - { - "id" : "Packy Anderson", - "name" : "Packy Anderson", - "data" : [ - [ - "Perl", - 2 - ], - [ - "Raku", - 2 - ], - [ - "Blog", - 1 - ] - ] - }, - { - "id" : "Peter Campbell Smith", - "name" : "Peter Campbell Smith", - "data" : [ - [ - "Perl", - 2 - ], - [ - "Blog", - 1 - ] - ] + "name" : "Matthew Neleigh" |
