The Weekly Challenge - 331

Monday, Jul 21, 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: Last Word

10. TASK #2: Buddy Strings


HEADLINES


Welcome to the Week #331 of The Weekly Challenge.

Let’s all welcome two new members to Team PWC: Harry Wozniak and Fabio Valeri to Team PWC. Both are experienced Perl hackers.

Do you remember our fellow team member, Humberto Massa?

Well, I recently discovered his Raku magics on social media. Another member who shares such insights is James Smith.

I noticed Humberto also posted something like:


@manwar again, from the endoscopy clinic wait room, ... `.

To be honest, this is worrisome. I hope and pray he’s ok.

I’ve copied his one-liners and saved them in the repository, so others can benefit from them as well.

A few years ago, I had to undergo an endoscopy myself. It was one of the scariest moments of my life.

Here in England, the school summer break starts this week. This time, my three school going angels won’t let me stay at home.

So I had to make a last minute booking for a short trip.

Travel Itenary:

- Departing: Saturday  26th July, 2025
- Returning: Wednesday 30th July, 2025

This will slightly disrupt the weekly challenge schedule.

So here’s the plan:

- I'll release the new challenge, Week #332, on Friday night or Saturday morning before leaving.
- This gives you all a couple of extra days to work on it.

There’s another small issue, I won’t be able to process all contributions for Week #331 immediately.

Why? Because some members submit their work on Sunday, so I’ll handle those when I return on Wednesday.

Additionally, my weekly contributions review for the Perl Weekly newsletter, will be partial this time.

Amid all this, I almost forgot to mention that we’ve once again received 100+ contributions once again, the third time in the year 2025 so far.

Well done Team PWC, let’s keep the momentum going strong.

Happy Hacking!!


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

  Week      Perl       Raku       Blog   
   326       48       27       28   
   327       48       24       15   
   328       44       27       22   
   329       46       24       25   
   330       50       29       25   

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

  Week      Guests       Contributions       Languages   
   326       13       64       23   
   327       14       36       13   
   328       11       31       11   
   329       15       46       15   
   330       12       62       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     (3486)
 2. Rust       (948)
 3. Ruby       (807)
 4. Haskell    (793)
 5. Lua        (737)
 6. C++        (633)
 7. C          (594)
 8. JavaScript (570)
 9. Go         (511)
10. BQN        (452)

Blogs with Creative Title


1. Clearly Capital by Arne Sommer.

2. Capital Cleared by Jorg Sommrey.

3. crunching words by Luca Ferrari.

4. Capitalizing on Regular Expressions by Matthias Muth.

5. TITLE OF THE POST by Packy Anderson.

6. Digitless Capitals by Peter Campbell Smith.

7. Clear Title by Roger Bell_West.

8. Clearly the Title by Simon Green.

9. Specifications, Ambiguity, Contradiction by Yitzchak Scott-Thoennes.


GitHub Repository Stats


1. Commits: 44,463 (+109)

2. Pull Requests: 12,336 (+40)

3. Contributors: 262

4. Fork: 332 (+2)

5. Stars: 195 (+1)



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 - 330 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


Harry Wozniak, an expert Perl hacker joined Team PWC.

Fabio Valeri, an expert Perl hacker joined 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.


GUESTS


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

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


Task 1: Last Word

Submitted by: Mohammad Sajid Anwar

You are given a string.

Write a script to find the length of last word in the given string.


Example 1

Input: $str = "The Weekly Challenge"
Output: 9

Example 2

Input: $str = "   Hello   World    "
Output: 5

Example 3

Input: $str = "Let's begin the fun"
Output: 3

Task 2: Buddy Strings

Submitted by: Mohammad Sajid Anwar

You are given two strings, source and target.

Write a script to find out if the given strings are Buddy Strings.

If swapping of a letter in one string make them same as the other then they are `Buddy Strings`.

Example 1

Input: $source = "fuck"
       $target = "fcuk"
Output: true

The swapping of 'u' with 'c' makes it buddy strings.

Example 2

Input: $source = "love"
       $target = "love"
Output: false

Example 3

Input: $source = "fodo"
       $target = "food"
Output: true

Example 4

Input: $source = "feed"
       $target = "feed"
Output: true


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


SO WHAT DO YOU THINK ?

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

Contact with me