diff options
26 files changed, 664 insertions, 493 deletions
diff --git a/challenge-336/eric-cheung/python/ch-1.py b/challenge-336/eric-cheung/python/ch-1.py new file mode 100755 index 0000000000..65adb5c6b2 --- /dev/null +++ b/challenge-336/eric-cheung/python/ch-1.py @@ -0,0 +1,14 @@ +
+from math import gcd
+
+## arrInt = [1, 1, 2, 2, 2, 2] ## Example 1
+## arrInt = [1, 1, 1, 2, 2, 2, 3, 3] ## Example 2
+## arrInt = [5, 5, 5, 5, 5, 5, 7, 7, 7, 7, 7, 7] ## Example 3
+## arrInt = [1, 2, 3, 4] ## Example 4
+arrInt = [8, 8, 9, 9, 10, 10, 11, 11] ## Example 5
+
+arrCount = [arrInt.count(nElem) for nElem in set(arrInt)]
+
+nGCD = gcd(*arrCount)
+
+print (nGCD > 1)
diff --git a/challenge-336/eric-cheung/python/ch-2.py b/challenge-336/eric-cheung/python/ch-2.py new file mode 100755 index 0000000000..ee0ecf47d2 --- /dev/null +++ b/challenge-336/eric-cheung/python/ch-2.py @@ -0,0 +1,29 @@ +
+## arrScore = ["5", "2", "C", "D", "+"] ## Example 1
+## arrScore = ["5", "-2", "4", "C", "D", "9", "+", "+"] ## Example 2
+## arrScore = ["7", "D", "D", "C", "+", "3"] ## Example 3
+## arrScore = ["-5", "-10", "+", "D", "C", "+"] ## Example 4
+arrScore = ["3", "6", "+", "D", "C", "8", "+", "D", "-2", "C", "+"] ## Example 5
+
+nIndx = 0
+while nIndx < len(arrScore):
+ strElem = arrScore[nIndx]
+
+ if "-" in strElem:
+ arrScore[nIndx] = -1 * int(strElem.replace("-", ""))
+ elif strElem.isdigit():
+ arrScore[nIndx] = int(strElem)
+ elif strElem == "+":
+ arrScore[nIndx] = sum(arrScore[nIndx - 2 : nIndx])
+ elif strElem == "C":
+ del arrScore[nIndx]
+ del arrScore[nIndx - 1]
+ nIndx = nIndx - 1
+ continue
+ elif strElem == "D":
+ arrScore[nIndx] = 2 * int(arrScore[nIndx - 1])
+
+ nIndx = nIndx + 1
+
+## print (arrScore)
+print (sum(arrScore))
diff --git a/stats/pwc-challenge-335.json b/stats/pwc-challenge-335.json new file mode 100644 index 0000000000..f81b2fdc4c --- /dev/null +++ b/stats/pwc-challenge-335.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", + 2 + ], + [ + "Raku", + 2 + ] + ], + "id" : "Athanasius", + "name" : "Athanasius" + }, + { + "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" : [ + [ + "Perl", + 2 + ], + [ + "Raku", + 2 + ], + [ + "Blog", + 1 + ] + ], + "id" : "Jaldhar H. Vyas", + "name" : "Jaldhar H. Vyas" + }, + { + "data" : [ + [ + "Raku", + 1 + ] + ], + "id" : "Jan Krnavek", + "name" : "Jan Krnavek" + }, + { + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 1 + ] + ], + "id" : "Jorg Sommrey", + "name" : "Jorg Sommrey" + }, + { + "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" + } + ] + }, + "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" : "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" : "Jaldhar H. Vyas", + "name" : "Jaldhar H. Vyas", + "y" : 5 + }, + { + "drilldown" : "Jan Krnavek", + "name" : "Jan Krnavek", + "y" : 1 + }, + { + "drilldown" : "Jorg Sommrey", + "name" : "Jorg Sommrey", + "y" : 3 + }, + { + "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 + } + ], + "name" : "The Weekly Challenge - 335" + } + ], + "subtitle" : { + "text" : "[Champions: 28] Last updated at 2025-08-25 09:41:20 GMT" + }, + "title" : { + "text" : "The Weekly Challenge - 335" + }, + "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 d5999eb93b..ed86e52244 100644 --- a/stats/pwc-current.json +++ b/stats/pwc-current.json @@ -7,322 +7,12 @@ { "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" : [ - [ - "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", - 1 - ] - ], - "id" : "Jan Krnavek", - "name" : "Jan Krnavek" - }, - { - "data" : [ - [ - "Perl", - 2 - ], - [ - "Blog", - 1 - ] - ], - "id" : "Jorg Sommrey", - "name" : "Jorg Sommrey" - }, - { - "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" } ] }, @@ -343,144 +33,19 @@ "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" : "David Ferrone", - "name" : "David Ferrone", - "y" : 2 - }, - { - "drilldown" : "E. Choroba", - "name" : "E. Choroba", - "y" : 2 - }, - { - "drilldown" : "Feng Chang", - "name" : "Feng Chang", - "y" : 2 - }, - { - "drilldown" : "Jan Krnavek", - "name" : "Jan Krnavek", - "y" : 1 - }, - { - "drilldown" : "Jorg Sommrey", - "name" : "Jorg Sommrey", - "y" : 3 - }, - { "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", |
