The Weekly Challenge - 221

Monday, Jun 12, 2023| Tags: Perl, Raku










09. TASK #1: Good Strings

10. TASK #2: Arithmetic Subsequence


Welcome to the Week #221 of The Weekly Challenge.

First thing first, let us all welcome new member, John Horner from Sydney, Australia to the Team PWC.

I know I didn’t declare the champion last week, sorry.

I will definitely announce the name next week.

Also I have yet to send the link to the Learning Perl Exercises book to the last few winners, I will sort that out too next week.

As I mentioned last week that I was in India to see my Dad. Unfortunately there is no improvement over the time I stayed wi th him (3rd June - 10th June).

I had return ticket booked for 10th June, so I left India leaving behind my Dad on the ventilator. We have been told by the doctors that there is not much hope left. It was the most difficult moment for me as you can imagine. I am still trying to accept the reality but I find it impossible to digest the truth. Luckily I have strong family and friends support here in the UK.

I would like to thanks everyone who sent me kind messages with regard to my Dad’s health.

Honestly I wanted to skip this week challenge but then somehome I got the energy in the middle of night and here you go.

I was supposed to edit the Perl Weekly Newsletter this week but I decided to skip it. Thanks to Gabor for helping me out.

This coming week is going to be very tough for me as I expect the bad news any moment. The worst part is I would miss the last rites. That is killing me to be honest.

I am so grateful to my current company Oleeo for all the support.

Let’s get back to the rouine stats.

Today, we are giving away Coupon #44 to Peter Meszaros for the book, Learning Perl Exercises by brian d foy. I will share the details with you in a separate email.


  S. No.    Name S. No.  Name
1.  Cheok-Yin Fung 2.  W. Luis Mochan
3.  Robert DiCicco 4.  Kueppo Wesley
5.  Solathian 6.  Dario Mazzeo
7.  Peter Campbell Smith   8.  Kjetil Skotheim
9.  Neils van Dijke 10.  Laurent Rosenfeld  
11.  Duncan C. White 12.  Ali Moradi
13.  Jorg Sommrey 14.  James Smith
15.  Alexander Pankoff 16.  Simon Green
17.  Robbie Hatley 18.  Bob Lied
19.  Athanasius 20.  David Ferrone
21.  Thomas Kohler 22.  Adam Russell
23.  E. Choroba 24.  Pip Stuart
25.  Roger Bell_West 26.  Flavio Poletti
27.  Dave Jacoby 28.  Mariano Spadaccini
29.  Lubos Kolouch 30.  Matthew Neleigh
31.  Paulo Custodio 32.  Tyler Bird
33.  Carlos Oliveira 34.  Avery Adams
35.  Matthias Muth 36.  Leo Manfredi
37.  Peter Meszaros 38.  Arne Sommer
39.  Jaldhar H. Vyas 40.  Mark Anderson
41.  Rob Turner 42.  BarrOff
43.  Robert Ransbottom 44.
45. 46.
47. 48.
49. 50.

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

  Week      Perl       Raku       Blog   
   216       39       22       22   
   217       60       32       23   
   218       43       22       16   
   219       35       22       22   
   220       49       29       18   

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

  Week      Guests       Contributions       Languages   
   216       11       33       14   
   217       09       34       13   
   218       10       36       15   
   219       12       37       15   
   220       06       32       10   

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  (1585)
 2. Haskell (555)
 3. Ruby    (527)
 4. Lua     (477)
 5. C       (424)
 6. C++     (379)
 7. Rust    (370)
 8. BQN     (299)
 9. Go      (258)
10. Java    (225)

Blogs with Creative Title

1. Squarefully Common by Arne Sommer.

2. I’ve Seen These Characters ‘Round These Parts by Avery Adams.

3. Squared Shoulders by Bruce Grays.

4. Perl by Nature - Squareful by Recursion by Matthias Muth.

5. Square Commoners by Roger Bell_West.

6. Common squares by Simon Green.

GitHub Repository Stats

1. Commits: 32,806 (+84)

2. Pull Requests: 8,206 (+32)

3. Contributors: 224

4. Fork: 281 (+1)

5. Stars: 156 (+3)

Our solo sponsor Pete Sergeant has been a great support to keep us motivated. We are lucky that he agreed to continue the journey with us in the year 2023. I would like to personally thank Pete and his entire team for their generosity. It would be great if we could add few more to sponsor the prize money so that we could go back and declare weekly champions as we have done in the past. I hope and wish this will become possible in 2023. The amount doesn’t have to be huge. However, it would be nice to show off bunch of supporters. If an organisation comes forward and supports us then that would be the ultimate achievement.


Quick recap of The Weekly Challenge - 220 by Mohammad S Anwar.


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


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


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.


John Horner an experienced Perl hacker for over 20 years from Sydney, Australia joined the Team PWC.

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.


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

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

Task 1: Good Strings

Submitted by: Mohammad S Anwar

You are given a list of @words and a string $chars.

A string is good if it can be formed by characters from $chars, each character can be used only once.

Write a script to return the sum of lengths of all good strings in words.

Example 1

Input: @words = ("cat", "bt", "hat", "tree")
       $chars = "atach"
Output: 6

The good strings that can be formed are "cat" and "hat" so the answer is 3 + 3 = 6.

Example 2

Input: @words = ("hello", "world", "challenge")
       $chars = "welldonehopper"
Output: 10

The strings that can be formed are "hello" and "world" so the answer is 5 + 5 = 10.

Task 2: Arithmetic Subsequence

Submitted by: Mohammad S Anwar

You are given an array of integers, @ints.

Write a script to find the length of the longest Arithmetic Subsequence in the given array.

A subsequence is an array that can be derived from another array by deleting some or none elements without changing the order of the remaining elements.

A subsquence is arithmetic if ints[i + 1] - ints[i] are all the same value (for 0 <= i < ints.length - 1).

Example 1:

Input: @ints = (9, 4, 7, 2, 10)
Output: 3

The longest Arithmetic Subsequence (4, 7, 10) can be derived by deleting 9 and 2.

Example 2:

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

No need to remove any elements, it is already an Arithmetic Subsequence.

Example 3:

Input: @ints = (20, 1, 15, 3, 10, 5, 8)
Output: 4

The longest Arithmetic Subsequence (20, 15, 10, 5) can be derived by deleting 1, 3 and 8.

Last date to submit the solution 23:59 (UK Time) Sunday 18th June 2023.


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

Contact with me