The Weekly Challenge - 338

Monday, Sep 8, 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: Highest Row

10. TASK #2: Max Distance


HEADLINES


Welcome to the Week #338 of The Weekly Challenge.

Thanks Thomas Kohler and Simon Proctor for confirming your acceptance of the prize money.

Thanks VHukman for sharing your Racket solutions for the first time.

Welcome back, Dave Jacoby, after your short break. Thank you for your consistently high quality contributions in Perl and your excellent blog post.

Looking at the stats from the past five weeks, I’ve noticed a dip in Raku contributions.

Although, Perl isn’t as dominant as it once was, it’s still holding its ground well, in my humble opinion.

I’ve also seen a rise in the quality blog post from the team. So a big Thank You to each and every one of you.

The guest contributions never disappoint, we consistently get 50+ every single week.

It’s always nice to see familiar names regularly sharing their knowledge with us.


Happy Hacking!!


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

  Week      Perl       Raku       Blog   
   333       52       27       25   
   334       46       27       15   
   335       38       21       12   
   336       44       24       13   
   337       44       17       14   

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

  Week      Guests       Contributions       Languages   
   333       11       56       19   
   334       12       56       19   
   335       12       54       19   
   336       12       52       18   
   337       13       54       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     (3572)
 2. Rust       (990)
 3. Ruby       (821)
 4. Haskell    (807)
 5. Lua        (763)
 6. C++        (647)
 7. C          (596)
 8. JavaScript (584)
 9. Go         (535)
10. BQN        (464)

Blogs with Creative Title


1. Oddly Current by Arne Sommer.

2. I Never Go Far Without A Little Big Star by Dave Jacoby.

3. Smaller Oddities by Jorg Sommrey.

4. Small Numbers, and No Matrix at All by Matthias Muth.

5. Small, but Oddly Current by Packy Anderson.

6. One and two dimensions by Peter Campbell Smith.

7. The Odd Current by Roger Bell_West.

8. Oddly small by Simon Green.


GitHub Repository Stats


1. Commits: 45,151 (+91)

2. Pull Requests: 12,596 (+34)

3. Contributors: 264

4. Fork: 336 (+1)

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 - 337 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 #337.

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


Task 1: Highest Row

Submitted by: Mohammad Sajid Anwar

You are given a m x n matrix.

Write a script to find the highest row sum in the given matrix.


Example 1

Input: @matrix = ([4,  4, 4, 4],
                  [10, 0, 0, 0],
                  [2,  2, 2, 9])
Output: 16

Row 1: 4  + 4 + 4 + 4 => 16
Row 2: 10 + 0 + 0 + 0 => 10
Row 3: 2  + 2 + 2 + 9 => 15

Example 2

Input: @matrix = ([1, 5],
                  [7, 3],
                  [3, 5])
Output: 10

Example 3

Input: @matrix = ([1, 2, 3],
                  [3, 2, 1])
Output: 6

Example 4

Input: @matrix = ([2, 8, 7],
                  [7, 1, 3],
                  [1, 9, 5])
Output: 17

Example 5

Input: @matrix = ([10, 20,  30],
                  [5,  5,   5],
                  [0,  100, 0],
                  [25, 25,  25])
Output: 100

Task 2: Max Distance

Submitted by: Mohammad Sajid Anwar

You are given two integer arrays, @arr1 and @arr2.

Write a script to find the maximum difference between any pair of values from both arrays.


Example 1

Input: @arr1 = (4, 5, 7)
       @arr2 = (9, 1, 3, 4)
Output: 6

With element $arr1[0] = 4
| 4 - 9 | = 5
| 4 - 1 | = 3
| 4 - 3 | = 1
| 4 - 4 | = 0
max distance = 5

With element $arr1[1] = 5
| 5 - 9 | = 4
| 5 - 1 | = 4
| 5 - 3 | = 2
| 5 - 4 | = 1
max distance = 4

With element $arr1[2] = 7
| 7 - 9 | = 2
| 7 - 1 | = 6
| 7 - 3 | = 4
| 7 - 4 | = 4
max distance = 6

max (5, 6, 6) = 6

Example 2

Input: @arr1 = (2, 3, 5, 4)
       @arr2 = (3, 2, 5, 5, 8, 7)
Output: 6

With element $arr1[0] = 2
| 2 - 3 | = 1
| 2 - 2 | = 0
| 2 - 5 | = 3
| 2 - 5 | = 3
| 2 - 8 | = 6
| 2 - 7 | = 5
max distance = 6

With element $arr1[1] = 3
| 3 - 3 | = 0
| 3 - 2 | = 1
| 3 - 5 | = 2
| 3 - 5 | = 2
| 3 - 8 | = 5
| 3 - 7 | = 4
max distance = 5

With element $arr1[2] = 5
| 5 - 3 | = 2
| 5 - 2 | = 3
| 5 - 5 | = 0
| 5 - 5 | = 0
| 5 - 8 | = 3
| 5 - 7 | = 2
max distance = 3

With element $arr1[3] = 4
| 4 - 3 | = 1
| 4 - 2 | = 2
| 4 - 5 | = 1
| 4 - 5 | = 1
| 4 - 8 | = 4
| 4 - 7 | = 3
max distance = 4

max (5, 6, 3, 4) = 6

Example 3

Input: @arr1 = (2, 1, 11, 3)
       @arr2 = (2, 5, 10, 2)
Output: 9

With element $arr1[0] = 2
| 2 - 2  | = 0
| 2 - 5  | = 3
| 2 - 10 | = 8
| 2 - 2  | = 0
max distance = 8

With element $arr1[1] = 1
| 1 - 2  | = 1
| 1 - 5  | = 4
| 1 - 10 | = 9
| 1 - 2  | = 1
max distance = 9

With element $arr1[2] = 11
| 11 - 2  | = 9
| 11 - 5  | = 6
| 11 - 10 | = 1
| 11 - 2  | = 9
max distance = 9

With element $arr1[3] = 3
| 3 - 2  | = 1
| 3 - 5  | = 2
| 3 - 10 | = 7
| 3 - 2  | = 1
max distance = 7

max (8, 9, 9, 7) = 9

Example 4

Input: @arr1 = (1, 2, 3)
       @arr2 = (3, 2, 1)
Output: 2

With element $arr1[0] = 1
| 1 - 3 | = 2
| 1 - 2 | = 1
| 1 - 1 | = 0
max distance = 2

With element $arr1[1] = 2
| 2 - 3 | = 1
| 2 - 2 | = 0
| 2 - 1 | = 1
max distance = 1

With element $arr1[2] = 3
| 3 - 3 | = 0
| 3 - 2 | = 1
| 3 - 1 | = 2
max distance = 2

max (2, 1, 2) = 2

Example 5

Input: @arr1 = (1, 0, 2, 3)
       @arr2 = (5, 0)
Output: 5

With element $arr1[0] = 1
| 1 - 5 | = 4
| 1 - 0 | = 1
max distance = 4

With element $arr1[1] = 0
| 0 - 5 | = 5
| 0 - 0 | = 0
max distance = 5

With element $arr1[2] = 2
| 2 - 5 | = 3
| 2 - 0 | = 2
max distance = 3

With element $arr1[3] = 3
| 3 - 5 | = 2
| 3 - 0 | = 3
max distance = 3

max (4, 5, 3, 3) = 5


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


SO WHAT DO YOU THINK ?

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

Contact with me