The Weekly Challenge - 322

Monday, May 19, 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: String Format

10. TASK #2: Rank Array


HEADLINES


Welcome to the Week #322 of The Weekly Challenge.

For the last two weeks, I keep forgetting to mention Andrew Shitov, who is back in action. We have had solutions to Week #320 and Week #321 in Raku so far.

Welcome back, Andrew, it’s always a pleasure to have you back. Thank you for your support and contributions.

I would also like to mention, Luca Ferrari, for getting back to his full capacity. For sometime, he only shared Raku solutions where he used to have mix of all. I noticed he is back with his magic once again. So, thank you for your contributions.

Similarly, Simon Green, once again started sharing solutions in Perl as well. I know his first choice is always, Python. And I must admit, he never disappoints me. Thank you for keeping the spirit high.

With so much happening, we matched the best week contributions of the year 2025. It was the Week #312 when we had 95 contributions. It was so close to the target.

Keep sharing the knowledge as always.

Well done, Team PWC, and thank you.


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

  Week      Perl       Raku       Blog   
   317       48       21       17   
   318       44       23       19   
   319       38       20       16   
   320       46       26       18   
   321       44       24       27   

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

  Week      Guests       Contributions       Languages   
   317       10       50       17   
   318       10       48       16   
   319       14       58       22   
   320       14       62       23   
   321       13       59       22   

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     (3372)
 2. Rust       (906)
 3. Ruby       (797)
 4. Haskell    (775)
 5. Lua        (722)
 6. C++        (615)
 7. C          (590)
 8. JavaScript (560)
 9. Go         (484)
10. BQN        (440)

Blogs with Creative Title


  1. Back to a Unique Evaluation by Adam Russell.

  2. Average Backspace by Arne Sommer.

  3. Every Average Tells a Story, Don’t It? by Bob Lied.

  4. Decreasing Order, Oddly by Dave Jacoby.

  5. Stepping Back and Forth by Jorg Sommrey.

  6. Distinctive Overlaps by Matthias Muth.

  7. Comparatively Distinct, but Great^H^H^H^H^HAverage by Packy Anderson.

  8. Moving backwards by Peter Campbell Smith.

  9. Just an Average Backspace by Roger Bell_West.

10. Compare the Average by Simon Green.


GitHub Repository Stats


1. Commits: 43,547 (+93)

2. Pull Requests: 12,026 (+35)

3. Contributors: 259

4. Fork: 326

5. Stars: 189



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

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


Task 1: String Format

Submitted by: Mohammad Sajid Anwar

You are given a string and a positive integer.

Write a script to format the string, removing any dashes, in groups of size given by the integer. The first group can be smaller than the integer but should have at least one character. Groups should be separated by dashes.


Example 1

Input: $str = "ABC-D-E-F", $i = 3
Output: "ABC-DEF"

Example 2

Input: $str = "A-BC-D-E", $i = 2
Output: "A-BC-DE"

Example 3

Input: $str = "-A-B-CD-E", $i = 4
Output: "A-BCDE"

Task 2: Rank Array

Submitted by: Mohammad Sajid Anwar

You are given an array of integers.

Write a script to return an array of the ranks of each element: the lowest value has rank 1, next lowest rank 2, etc. If two elements are the same then they share the same rank.


Example 1

Input: @ints = (55, 22, 44, 33)
Output: (4, 1, 3, 2)

Example 2

Input: @ints = (10, 10, 10)
Output: (1, 1, 1)

Example 3

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


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


SO WHAT DO YOU THINK ?

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

Contact with me