diff options
| author | Mohammad Sajid Anwar <mohammad.anwar@yahoo.com> | 2025-06-10 09:30:01 +0100 |
|---|---|---|
| committer | Mohammad Sajid Anwar <mohammad.anwar@yahoo.com> | 2025-06-10 09:30:01 +0100 |
| commit | a9f099b09f5cd637d39b54abbd42dd0d49fe497d (patch) | |
| tree | e83cd8d0a10bd74308e3c62ecbfbeb1acb48440d | |
| parent | 35a38c808be437c6404f0a02c3c5308597e02255 (diff) | |
| download | perlweeklychallenge-club-a9f099b09f5cd637d39b54abbd42dd0d49fe497d.tar.gz perlweeklychallenge-club-a9f099b09f5cd637d39b54abbd42dd0d49fe497d.tar.bz2 perlweeklychallenge-club-a9f099b09f5cd637d39b54abbd42dd0d49fe497d.zip | |
- Added solutions by Eric Cheung.
- Added solutions by Thomas Kohler.
- Added solutions by E. Choroba.
- Added solutions by Niels van Dijke.
- Added solutions by Andrew Shitov.
- Added solutions by Mark Anderson.
- Added solutions by Peter Campbell Smith.
- Added solutions by David Ferrone.
- Added solutions by W. Luis Mochan.
- Added solutions by Robbie Hatley.
- Added solutions by Ali Moradi.
- Added solutions by Feng Chang.
- Added solutions by PokGoPun.
- Added solutions by Andreas Mahnke.
- Added solutions by Peter Meszaros.
28 files changed, 718 insertions, 392 deletions
diff --git a/challenge-325/eric-cheung/python/ch-1.py b/challenge-325/eric-cheung/python/ch-1.py new file mode 100755 index 0000000000..6cc76254d9 --- /dev/null +++ b/challenge-325/eric-cheung/python/ch-1.py @@ -0,0 +1,22 @@ +
+## arrBinary = [0, 1, 1, 0, 1, 1, 1] ## Example 1
+## arrBinary = [0, 0, 0, 0] ## Example 2
+arrBinary = [1, 0, 1, 0, 1, 1] ## Example 3
+
+nMaxOne = 0
+nCountOne = 0
+
+for nBinLoop in arrBinary:
+ if nBinLoop == 0:
+ if nCountOne > nMaxOne:
+ nMaxOne = nCountOne
+
+ nCountOne = 0
+ continue
+
+ nCountOne = nCountOne + 1
+
+if nCountOne > nMaxOne:
+ nMaxOne = nCountOne
+
+print (nMaxOne)
diff --git a/challenge-325/eric-cheung/python/ch-2.py b/challenge-325/eric-cheung/python/ch-2.py new file mode 100755 index 0000000000..997d8bbb8a --- /dev/null +++ b/challenge-325/eric-cheung/python/ch-2.py @@ -0,0 +1,18 @@ +
+## Ref.:
+## https://www.tutorialspoint.com/program-to-find-final-prices-with-a-special-discount-in-a-shop-in-python
+
+## arrPrice = [8, 4, 6, 2, 3] ## Example 1
+## arrPrice = [1, 2, 3, 4, 5] ## Example 2
+arrPrice = [7, 1, 1, 5] ## Example 3
+
+arrOutput = []
+
+for nIndx, nPrice in enumerate(arrPrice):
+ arrDiscount = [arrPrice[nSubIndxLoop] for nSubIndxLoop in range(nIndx + 1, len(arrPrice)) if arrPrice[nSubIndxLoop] <= nPrice]
+
+ nDiscount = (0 if len(arrDiscount) == 0 else arrDiscount[0])
+
+ arrOutput.append(nPrice - nDiscount)
+
+print (arrOutput)
diff --git a/challenge-325/perlboy1967/perl/ch1.pl b/challenge-325/perlboy1967/perl/ch-1.pl index 941e10119d..941e10119d 100755 --- a/challenge-325/perlboy1967/perl/ch1.pl +++ b/challenge-325/perlboy1967/perl/ch-1.pl diff --git a/challenge-325/perlboy1967/perl/ch2.pl b/challenge-325/perlboy1967/perl/ch-2.pl index 9e2ccbaa41..9e2ccbaa41 100755 --- a/challenge-325/perlboy1967/perl/ch2.pl +++ b/challenge-325/perlboy1967/perl/ch-2.pl diff --git a/stats/pwc-challenge-324.json b/stats/pwc-challenge-324.json new file mode 100644 index 0000000000..954f4508b1 --- /dev/null +++ b/stats/pwc-challenge-324.json @@ -0,0 +1,559 @@ +{ + "chart" : { + "type" : "column" + }, + "drilldown" : { + "series" : [ + { + "data" : [ + [ + "Perl", + 2 + ], + [ + "Blog", + 2 + ] + ], + "id" : "Adam Russell", + "name" : "Adam Russell" + }, + { + "data" : [ + [ + "Perl", + 2 + ] + ], + "id" : "Alexander Karelas", + "name" : "Alexander Karelas" + }, + { + "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", + 2 + ] + ], + "id" : "BarrOff", + "name" : "BarrOff" + }, + { + "data" : [ + [ + "Perl", + 2 + ] + ], + "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", + 2 + ] + ], + "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 + ], + [ + "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" : [ + [ + "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 + ], + [ + "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" : "Adam Russell", + "name" : "Adam Russell", + "y" : 4 + }, + { + "drilldown" : "Alexander Karelas", + "name" : "Alexander Karelas", + "y" : 2 + }, + { + "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" : 2 + }, + { + "drilldown" : "Bob Lied", + "name" : "Bob Lied", + "y" : 2 + }, + { + "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" : 2 + }, + { + "drilldown" : "Jorg Sommrey", + "name" : "Jorg Sommrey", + "y" : 3 + }, + { + "drilldown" : "Mark Anderson", + "name" : "Mark Anderson", + "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" : "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" : "Yitzchak Scott-Thoennes", + "name" : "Yitzchak Scott-Thoennes", + "y" : 3 + } + ], + "name" : "The Weekly Challenge - 324" + } + ], + "subtitle" : { + "text" : "[Champions: 29] Last updated at 2025-06-10 08:29:51 GMT" + }, + "title" : { + "text" : "The Weekly Challenge - 324" + }, + "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 2e25c84639..936f3790aa 100644 --- a/stats/pwc-current.json +++ b/stats/pwc-current.json @@ -12,30 +12,6 @@ ], [ "Blog", - 2 - ] - ], - "id" : "Adam Russell", - "name" : "Adam Russell" - }, - { - "data" : [ - [ - "Perl", - 2 - ] - ], - "id" : "Alexander Karelas", - "name" : "Alexander Karelas" - }, - { - "data" : [ - [ - "Perl", - 2 - ], - [ - "Blog", 1 ] ], @@ -65,55 +41,7 @@ { "data" : [ [ - "Raku", - 2 - ], - [ "Blog", - 1 - ] - ], - "id" : "Arne Sommer", - "name" : "Arne Sommer" - }, - { - "data" : [ - [ - "Perl", - 2 - ], - [ - "Raku", - 2 - ] - ], - "id" : "Athanasius", - "name" : "Athanasius" - }, - { - "data" : [ - [ - "Raku", - 2 - ] - ], - "id" : "BarrOff", - "name" : "BarrOff" - }, - { - "data" : [ - [ - "Perl", - 2 - ] - ], - "id" : "Bob Lied", - "name" : "Bob Lied" - }, - { - "data" : [ - [ - "Perl", 2 ] ], @@ -143,48 +71,6 @@ { "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" : [ - [ "Raku", 2 ] @@ -197,20 +83,6 @@ [ "Perl", 2 - ], - [ - "Blog", - 1 - ] - ], - "id" : "Matthias Muth", - "name" : "Matthias Muth" - }, - { - "data" : [ - [ - "Perl", - 2 ] ], "id" : "Niels van Dijke", @@ -223,24 +95,6 @@ 2 ], [ - "Raku", - 2 - ], - [ - "Blog", - 1 - ] - ], - "id" : "Packy Anderson", - "name" : "Packy Anderson" - }, - { - "data" : [ - [ - "Perl", - 2 - ], - [ "Blog", 1 ] @@ -275,48 +129,6 @@ { "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" : [ - [ "Perl", 2 ], @@ -335,40 +147,12 @@ 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 - ], - [ - "Blog", - 1 - ] - ], - "id" : "Yitzchak Scott-Thoennes", - "name" : "Yitzchak Scott-Thoennes" } ] }, @@ -389,16 +173,6 @@ "colorByPoint" : 1, "data" : [ { - "drilldown" : "Adam Russell", - "name" : "Adam Russell", - "y" : 4 - }, - { - "drilldown" : "Alexander Karelas", - "name" : "Alexander Karelas", - "y" : 2 - }, - { "drilldown" : "Ali Moradi", "name" : "Ali Moradi", "y" : 3 @@ -414,26 +188,6 @@ "y" : 2 }, { - "drilldown" : "Arne Sommer", - "name" : "Arne Sommer", - "y" : 3 - }, - { - "drilldown" : "Athanasius", - "name" : "Athanasius", - "y" : 4 - }, - { - "drilldown" : "BarrOff", - "name" : "BarrOff", - "y" : 2 - }, - { - "drilldown" : "Bob Lied", - "name" : "Bob Lied", - "y" : 2 - }, - { "drilldown" : "David Ferrone", "name" : "David Ferrone", "y" : 2 @@ -449,41 +203,16 @@ "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" : "Mark Anderson", "name" : "Mark Anderson", "y" : 2 }, { - "drilldown" : "Matthias Muth", - "name" : "Matthias Muth", - "y" : 3 - }, - { |
