The Weekly Challenge - 339

Monday, Sep 15, 2025| Tags: Perl, Raku

TABLE OF CONTENTS


  1. HEADLINES

  2. SPONSOR

  3. RECAP

  4. PERL REVIEW

  5. RAKU REVIEW

  6. CHART

  7. NEW MEMBERS

  8. GUESTS

  9. TASK #1: Max Diff

10. TASK #2: Peak Point


HEADLINES


Welcome to the Week #339 of The Weekly Challenge.

Once again, the quality of guest contributions continues to improve week after week and the blog posts are maintaining their high standard.

I’ve noticed that Rust continues to rise and is soon expected to surpass 1000 contributions while Python continues to maintain it’s #1 rank.

I’d like to call on all Raku fans to give us another push. We are fortunate to have dedicated Raku contributors like Andrew Shitov, Arne Sommer, BarrOff, Simon Proctor. I also believe our dedicated Perl masters should give Raku a try.

There was a time when I regularly contributed in Perl, Raku, Python and Swift. I even blogged about it. May be, it’s high time I got back in the game.

Happy Hacking!!


Last 5 weeks mainstream contribution stats. Thank you Team PWC for your support and encouragements.

  Week      Perl       Raku       Blog   
   334       46       27       15   
   335       38       21       12   
   336       44       24       13   
   337       44       17       14   
   338       45       19       14   

Last 5 weeks guest contribution stats. Thank you each and every guest contributors for your time and efforts.

  Week      Guests       Contributions       Languages   
   334       12       56       19   
   335       12       54       19   
   336       12       52       18   
   337       13       54       19   
   338       13       58       19   

TOP 10 Guest Languages


Do you see your favourite language in the Top #10? If not then why not contribute regularly and make it to the top.

 1. Python     (3586)
 2. Rust       (996)
 3. Ruby       (823)
 4. Haskell    (811)
 5. Lua        (767)
 6. C++        (649)
 7. C          (596)
 8. JavaScript (586)
 9. Go         (539)
10. BQN        (466)

Blogs with Creative Title


1. Row the Distance by Arne Sommer.

2. Maximal maximization of maximums by Bob Lied.

3. Vectored Max by Jorg Sommrey.

4. Higher and Higher by Matthias Muth.

5. Maxwell’s Silver Highest by Packy Anderson.

6. High and far by Peter Campbell Smith.

7. Mad Max Beyond Perldome by Robbie Hatley.

8. Highest to the Max by Roger Bell_West.

9. The Highest Distance by Simon Green.


GitHub Repository Stats


1. Commits: 45,257 (+106)

2. Pull Requests: 12,633 (+37)

3. Contributors: 264

4. Fork: 336

5. Stars: 196



With start of Week #268, we have a new sponsor Lance Wicks until the end of year 2025. Having said we are looking for more sponsors so that we can go back to weekly winner. If anyone interested please get in touch with us at perlweeklychallenge@yahoo.com. Thanks for your support in advance.


RECAP


Quick recap of The Weekly Challenge - 338 by Mohammad Sajid Anwar.


PERL REVIEW


If you missed any past reviews then please check out the collection.


RAKU REVIEW


If you missed any past reviews then please check out the collection.


CHART


Please take a look at the charts showing interesting data.

I would like to THANK every member of the team for their valuable suggestions. Please do share your experience with us.


NEW MEMBERS


Please find out How to contribute?, if you have any doubts.

Please try the excellent tool EZPWC created by respected member Saif Ahmed of Team PWC.


GUESTS


Please check out the guest contributions for the Week #338.

Please find past solutions by respected guests. Please share your creative solutions in other languages.


Task 1: Max Diff

Submitted by: Mohammad Sajid Anwar

You are given an array of integers having four or more elements.

Write a script to find two pairs of numbers from this list (four numbers total) so that the difference between their products is as large as possible.

In the end return the max difference.

With Two pairs (a, b) and (c, d), the product difference is (a * b) - (c * d).


Example 1

Input: @ints = (5, 9, 3, 4, 6)
Output: 42

Pair 1: (9, 6)
Pair 2: (3, 4)
Product Diff: (9 * 6) - (3 * 4) => 54 - 12 => 42

Example 2

Input: @ints = (1, -2, 3, -4)
Output: 10

Pair 1: (1, -2)
Pair 2: (3, -4)

Example 3

Input: @ints = (-3, -1, -2, -4)
Output: 10

Pair 1: (-1, -2)
Pair 2: (-3, -4)

Example 4

Input: @ints = (10, 2, 0, 5, 1)
Output: 50

Pair 1: (10, 5)
Pair 2: (0, 1)

Example 5

Input: @ints = (7, 8, 9, 10, 10)
Output: 44

Pair 1: (10, 10)
Pair 2: (7, 8)

Task 2: Peak Point

Submitted by: Mohammad Sajid Anwar

You are given an array of altitude gain.

Write a script to find the peak point gained.


Example 1

Input: @gain = (-5, 1, 5, -9, 2)
Output: 1

start: 0
1st change:  0 + (-5) = -5
2nd change: -5 + 1    = -4
3rd change: -4 + 5    = 1
4th change:  1 + (-9) = -8
5th change: -8 + 2    = -6

max(0, -5, -4, 1, -8, -6) = 1

Example 2

Input: @gain = (10, 10, 10, -25)
Output: 30

start: 0
1st change:  0 + 10    = 10
2nd change: 10 + 10    = 20
3rd change: 20 + 10    = 30
4th change: 30 + (-25) = 5

max(0, 10, 20, 30, 5) = 30

Example 3

Input: @gain = (3, -4, 2, 5, -6, 1)
Output: 6

start: 0
1st change:  0 + 3    = 3
2nd change:  3 + (-4) = -1
3rd change: -1 + 2    = 1
4th change:  1 + 5    = 6
5th change:  6 + (-6) = 0
6th change:  0 + 1    = 1

max(0, 3, -1, 1, 6, 0, 1) = 6

Example 4

Input: @gain = (-1, -2, -3, -4)
Output: 0

start: 0
1st change:  0 + (-1) = -1
2nd change: -1 + (-2) = -3
3rd change: -3 + (-3) = -6
4th change: -6 + (-4) = -10

max(0, -1, -3, -6, -10) = 0

Example 5

Input: @gain = (-10, 15, 5)
Output: 10

start: 0
1st change:   0 + (-10) = -10
2nd change: -10 + 15    = 5
3rd change:   5 + 5     = 10

max(0, -10, 5, 10) = 10


Last date to submit the solution 23:59 (UK Time) Sunday 21st September 2025.


SO WHAT DO YOU THINK ?

If you have any suggestions or ideas then please do share with us.

Contact with me