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: Special Average
10. TASK #2: Arithmetic Progression
HEADLINES
Welcome to the Week #351 of The Weekly Challenge.
Let us all welcome, Gerben Vos to Team PWC. Thanks Gerben for the first contributions in Perl.
Last week, I completely forgot to announce the champion in all the excitement. With great pleasure, I declare Peter Meszaros as the next Champion of the Month.He was last declared champion in Nov 2023. He is currently ranked #40 in the leader board with total score of 302. And currently ranked #22 in guest contributions leader board with contributions in Tcl.
Niels van Dijke please reply to the email that was sent on 18th Nov with regard to the prize money.
Thank you, Arne Sommer, for the kind and encouraging words in your blog post. I loved the post title image, it made my day.
Below is my contributions to the Task #1 of Week #350.
Perl: source code
sub good_substring {
my ($str) = @_;
return grep { !/(.).*\1/ }
map { substr($str, $_, 3) }
0..length($str) - 3;
}
Raku: source code
sub good-substring(Str $str) {
$str.comb.rotor(3 => -2).map(*.join).grep({!/(.).*$0/}).elems
}
Python: source code
def good_substring(s: str) -> int:
return sum(1 for i in range(len(s) - 2)
if len(set(s[i:i+3])) == 3)
Thank you Team PWC, once again.
Happy Hacking!!
Advent Calendar 2025
Contributions to the Advent Calendar so far by fellow members.
Day 1: 3-digits Even/Delete and Earn by Ali Moradi.
Day 2: Not Modified by Dave Jacoby.
Day 3: Alien Primes by Jorg Sommrey.
Day 4: Odd game by Peter Campbell Smith.
Day 5: Don’t Get Trapped by Matthias Muth.
Day 6: Exclusive or Common by Arne Sommer.
Day 7: Perl and Raku mainly by Luca Ferrari.
Day 8: Arrays Intersection/Sort Odd Even by Jaldhar H. Vyas.
Last 5 weeks mainstream contribution stats. Thank you Team PWC for your support and encouragements.
Week |
Perl |
Raku |
Blog |
346 |
50 | 18 | 15 |
347 |
47 | 21 | 24 |
348 |
47 | 23 | 26 |
349 |
49 | 23 | 26 |
350 |
44 | 14 | 16 |
Last 5 weeks guest contribution stats. Thank you each and every guest contributors for your time and efforts.
Week |
Guests |
Contributions |
Languages |
346 |
15 | 51 | 17 |
347 |
16 | 67 | 21 |
348 |
16 | 70 | 23 |
349 |
18 | 83 | 24 |
350 |
13 | 57 | 17 |
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 (3807)
2. Rust (1060)
3. Ruby (852)
4. Haskell (839)
5. Lua (804)
6. C++ (672)
7. JavaScript (604)
8. C (596)
9. Go (594)
10. BQN (487)
Blogs with Creative Title
1. The Good Shuffle by Arne Sommer.
2. Shuffled Strings by Jorg Sommrey.
3. only Perl! by Luca Ferrari.
4. Shuffling the Good by Packy Anderson.
5. Good pairs by Peter Campbell Smith.
6. A Good Shuffle by Roger Bell_West.
7. Good shuffling by Simon Green.
GitHub Repository Stats
1. Commits: 46,601 (+85)
2. Pull Requests: 13,103 (+30)
3. Contributors: 267 (+1)
4. Fork: 343 (+1)
5. Stars: 202
SPONSOR
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 - 350 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
Gerben Vos, 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 #350.
Please find past solutions by respected guests. Please share your creative solutions in other languages.
Task 1: Special Average
Submitted by: Mohammad Sajid Anwar
You are given an array of integers.
Write a script to return the average excluding the minimum and maximum of the given array.
Example 1
Input: @ints = (8000, 5000, 6000, 2000, 3000, 7000)
Output: 5250
Min: 2000
Max: 8000
Avg: (3000+5000+6000+7000)/4 = 21000/4 = 5250
Example 2
Input: @ints = (100_000, 80_000, 110_000, 90_000)
Output: 95_000
Min: 80_000
Max: 110_000
Avg: (100_000 + 90_000)/2 = 190_000/2 = 95_000
Example 3
Input: @ints = (2500, 2500, 2500, 2500)
Output: 0
Min: 2500
Max: 2500
Avg: 0
Example 4
Input: @ints = (2000)
Output: 0
Min: 2000
Max: 2000
Avg: 0
Example 5
Input: @ints = (1000, 2000, 3000, 4000, 5000, 6000)
Output: 3500
Min: 1000
Max: 6000
Avg: (2000 + 3000 + 4000 + 5000)/4 = 14000/4 = 3500
Task 2: Arithmetic Progression
Submitted by: Mohammad Sajid Anwar
You are given an array of numbers.
Write a script to return true if the given array can be re-arranged to form an arithmetic progression, otherwise return false.
A sequence of numbers is called an arithmetic progression if the difference between any two consecutive elements is the same.
Example 1
Input: @num = (1, 3, 5, 7, 9)
Output: true
Already AP with common difference 2.
Example 2
Input: @num = (9, 1, 7, 5, 3)
Output: true
The given array re-arranged like (1, 3, 5, 7, 9) with common difference 2.
Example 3
Input: @num = (1, 2, 4, 8, 16)
Output: false
This is geometric progression and not arithmetic progression.
Example 4
Input: @num = (5, -1, 3, 1, -3)
Output: true
The given array re-arranged like (-3, -1, 1, 3, 5) with common difference 2.
Example 5
Input: @num = (1.5, 3, 0, 4.5, 6)
Output: true
The given array re-arranged like (0, 1.5, 3, 4.5, 6) with common difference 1.5.
Last date to submit the solution 23:59 (UK Time) Sunday 14th December 2025.