diff options
| author | Mohammad Sajid Anwar <mohammad.anwar@yahoo.com> | 2025-10-27 14:35:15 +0000 |
|---|---|---|
| committer | Mohammad Sajid Anwar <mohammad.anwar@yahoo.com> | 2025-10-27 14:35:15 +0000 |
| commit | abe996e9ac2cb8caef4b993c2135a7f0d14bf455 (patch) | |
| tree | 1543b42b2ad0f71f82d85e59cef798e5b7c6ea3a | |
| parent | dd0b42d3cf5d83c2b6d38485422b5778a32f1e6a (diff) | |
| download | perlweeklychallenge-club-abe996e9ac2cb8caef4b993c2135a7f0d14bf455.tar.gz perlweeklychallenge-club-abe996e9ac2cb8caef4b993c2135a7f0d14bf455.tar.bz2 perlweeklychallenge-club-abe996e9ac2cb8caef4b993c2135a7f0d14bf455.zip | |
- Added solutions by Eric Cheung.
- Added solutions by Mark Anderson.
- Added solutions by Lubos Kolouch.
- Added solutions by Ali Moradi.
- Added solutions by Feng Chang.
- Added solutions by Andreas Mahnke.
- Added solutions by Peter Campbell Smith.
26 files changed, 761 insertions, 544 deletions
diff --git a/challenge-345/eric-cheung/python/ch-1.py b/challenge-345/eric-cheung/python/ch-1.py new file mode 100755 index 0000000000..fffcde2be1 --- /dev/null +++ b/challenge-345/eric-cheung/python/ch-1.py @@ -0,0 +1,23 @@ +
+## arrInts = [1, 3, 2] ## Example 1
+## arrInts = [2, 4, 6, 5, 3] ## Example 2
+## arrInts = [1, 2, 3, 2, 4, 1] ## Example 3
+## arrInts = [5, 3, 1] ## Example 4
+arrInts = [1, 5, 1, 5, 1, 5, 1] ## Example 5
+
+arrOutput = []
+
+for nIndx, nElem in enumerate(arrInts):
+ bIsPeak = False
+
+ if nIndx == 0 and nElem > arrInts[nIndx + 1]:
+ bIsPeak = True
+ elif nIndx == len(arrInts) - 1 and nElem > arrInts[nIndx - 1]:
+ bIsPeak = True
+ elif nElem > arrInts[nIndx - 1] and nElem > arrInts[nIndx + 1]:
+ bIsPeak = True
+
+ if bIsPeak:
+ arrOutput.append(nIndx)
+
+print (arrOutput)
diff --git a/challenge-345/eric-cheung/python/ch-2.py b/challenge-345/eric-cheung/python/ch-2.py new file mode 100755 index 0000000000..5a4b728ca3 --- /dev/null +++ b/challenge-345/eric-cheung/python/ch-2.py @@ -0,0 +1,25 @@ +
+## Ref.:
+## https://leetcode.com/problems/last-visited-integers/description/
+
+## arrInts = [5, -1, -1] ## Example 1
+## arrInts = [3, 7, -1, -1, -1] ## Example 2
+## arrInts = [2, -1, 4, -1, -1] ## Example 3
+## arrInts = [10, 20, -1, 30, -1, -1] ## Example 4
+## arrInts = [-1, -1, 5, -1] ## Example 5
+
+## arrInts = [1, 2, -1, -1, -1] ## Example 6
+arrInts = [1, -1, 2, -1, -1] ## Example 7
+
+arrSeen = []
+arrAns = []
+arrMinusOne = []
+
+for nElem in arrInts:
+ if nElem > 0:
+ arrSeen.insert(0, nElem)
+ else:
+ arrAns.append(arrSeen[len(arrMinusOne)] if len(arrMinusOne) < len(arrSeen) else nElem)
+ arrMinusOne.append(nElem)
+
+print (arrAns)
diff --git a/stats/pwc-challenge-344.json b/stats/pwc-challenge-344.json new file mode 100644 index 0000000000..d0d6fdccb6 --- /dev/null +++ b/stats/pwc-challenge-344.json @@ -0,0 +1,623 @@ +{ + "chart" : { + "type" : "column" + }, + "drilldown" : { + "series" : [ + { + "data" : [ + [ + "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" : [ + [ + "Raku", + 1 + ] + ], + "id" : "Asher Harvey-Smith", + "name" : "Asher Harvey-Smith" + }, + { + "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" : [ + [ + "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" : [ + [ + "Perl", + 2 + ] + ], + "id" : "Lubos Kolouch", + "name" : "Lubos Kolouch" + }, + { + "data" : [ + [ + "Raku", + 2 + ], + [ + "Blog", + 2 + ] + ], + "id" : "Luca Ferrari", + "name" : "Luca Ferrari" + }, + { + "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", + 1 + ], + [ + "Raku", + 1 + ] + ], + "id" : "Mohammad Sajid Anwar", + "name" : "Mohammad Sajid Anwar" + }, + { + "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 + ], + [ + "Blog", + 1 + ] + ], + "id" : "Roger Bell_West", + "name" : "Roger Bell_West" + }, + { + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 1 + ] + ], + "id" : "Simon Green", + "name" : "Simon Green" + }, + { + "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 + ], + [ + "Raku", + 1 + ], + [ + "Blog", + 1 + ] + ], + "id" : "Vinod Kumar K", + "name" : "Vinod Kumar K" + }, + { + "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" : 1 + }, + { + "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" : "Asher Harvey-Smith", + "name" : "Asher Harvey-Smith", + "y" : 1 + }, + { + "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" : "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" : "Lubos Kolouch", + "name" : "Lubos Kolouch", + "y" : 2 + }, + { + "drilldown" : "Luca Ferrari", + "name" : "Luca Ferrari", + "y" : 4 + }, + { + "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" : "Mohammad Sajid Anwar", + "name" : "Mohammad Sajid Anwar", + "y" : 2 + }, + { + "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" : 3 + }, + { + "drilldown" : "Simon Green", + "name" : "Simon Green", + "y" : 3 + }, + { + "drilldown" : "Thomas Kohler", + "name" : "Thomas Kohler", + "y" : 4 + }, + { + "drilldown" : "Ulrich Rieke", + "name" : "Ulrich Rieke", + "y" : 4 + }, + { + "drilldown" : "Vinod Kumar K", + "name" : "Vinod Kumar K", + "y" : 4 + }, + { + "drilldown" : "W. Luis Mochan", + "name" : "W. Luis Mochan", + "y" : 3 + }, + { + "drilldown" : "Wanderdoc", + "name" : "Wanderdoc", + "y" : 2 + } + ], + "name" : "The Weekly Challenge - 344" + } + ], + "subtitle" : { + "text" : "[Champions: 33] Last updated at 2025-10-27 14:34:48 GMT" + }, + "title" : { + "text" : "The Weekly Challenge - 344" + }, + "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 015103105b..9fbe1f9332 100644 --- a/stats/pwc-current.json +++ b/stats/pwc-current.json @@ -7,84 +7,6 @@ { "data" : [ [ - "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" : [ - [ - "Raku", - 1 - ] - ], - "id" : "Asher Harvey-Smith", - "name" : "Asher Harvey-Smith" - }, - { - "data" : [ - [ - "Perl", - 2 - ], - [ - "Raku", - 2 - ] - ], - "id" : "Athanasius", - "name" : "Athanasius" - }, - { - "data" : [ - [ - "Raku", - 1 - ] - ], - "id" : "BarrOff", - "name" : "BarrOff" - }, - { - "data" : [ - [ "Perl", 2 ], @@ -93,18 +15,8 @@ 1 ] ], - "id" : "Bob Lied", - "name" : "Bob Lied" - }, - { - "data" : [ - [ - "Perl", - 2 - ] - ], - "id" : "David Ferrone", - "name" : "David Ferrone" + "id" : "Ali Moradi", + "name" : "Ali Moradi" }, { "data" : [ @@ -113,8 +25,8 @@ 2 ] ], - "id" : "E. Choroba", - "name" : "E. Choroba" + "id" : "Andreas Mahnke", + "name" : "Andreas Mahnke" }, { "data" : [ @@ -131,48 +43,6 @@ [ "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" : [ - [ - "Perl", - 2 ] ], "id" : "Lubos Kolouch", @@ -183,20 +53,6 @@ [ "Raku", 2 - ], - [ - "Blog", - 2 - ] - ], - "id" : "Luca Ferrari", - "name" : "Luca Ferrari" - }, - { - "data" : [ - [ - "Raku", - 2 ] ], "id" : "Mark Anderson", @@ -207,72 +63,6 @@ [ "Perl", 2 - ] - ], - "id" : "Matthew Neleigh", - "name" : "Matthew Neleigh" - }, - { - "data" : [ - [ - "Perl", - 2 - ], - [ - "Blog", - 1 - ] - ], - "id" : "Matthias Muth", - "name" : "Matthias Muth" - }, - { - "data" : [ - [ - "Perl", - 1 - ], - [ - "Raku", - 1 - ] - ], - "id" : "Mohammad Sajid Anwar", - "name" : "Mohammad Sajid Anwar" - }, - { - "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", @@ -281,138 +71,6 @@ ], "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 - ], - [ - "Blog", - 1 - ] - ], - "id" : "Roger Bell_West", - "name" : "Roger Bell_West" - }, - { - "data" : [ - [ - "Perl", - 2 - ], - [ - "Blog", - 1 - ] - ], - "id" : "Simon Green", - "name" : " |
