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: Distinct Average
10. TASK #2: Backspace Compare
HEADLINES
Welcome to the Week #321
of The Weekly Challenge
.
I would like to thank, Eric Cheung
and Vinod Kumar K
for prompt response with payment details. I am so happy that it’s done and dusted.
Thank you, VHukman
, for sharing solutions in a new programming language, Retro.
Thank you, Roger Bell_West
, for sharing solutions in a new programming language, Typst.
So, now we have contributions in 115
different guest languages as well as Perl
and Raku
.
I noticed, last week was the best week for guest contributions as compared to the last 5-weeks.
Having said, I am still waiting for the first 100+
contributions of the year 2025
.
Happy Hacking!
Last 5 weeks
mainstream contribution stats. Thank you Team PWC
for your support and encouragements.
Week |
Perl |
Raku |
Blog |
316 |
50 | 23 | 18 |
317 |
48 | 21 | 17 |
318 |
44 | 23 | 19 |
319 |
38 | 20 | 16 |
320 |
42 | 24 | 17 |
Last 5 weeks
guest contribution stats. Thank you each and every guest contributors for your time and efforts.
Week |
Guests |
Contributions |
Languages |
316 |
11 | 52 | 19 |
317 |
10 | 50 | 17 |
318 |
10 | 48 | 16 |
319 |
14 | 58 | 22 |
320 |
14 | 62 | 23 |
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 (3359)
2. Rust (902)
3. Ruby (795)
4. Haskell (773)
5. Lua (720)
6. C++ (613)
7. C (590)
8. JavaScript (558)
9. Go (482)
10. BQN (438)
Blogs with Creative Title
1. Summit of Count Deviation by Adam Russell.
2. Count Difference by Arne Sommer.
3. Different Counts by Jorg Sommrey.
4. Simple and Fast! by Luca Ferrari.
5. Elegance Makes the Maximum Difference by Matthias Muth.
6. Happy Mother’s Day by Packy Anderson.
7. Fun with integers by Peter Campbell Smith.
8. The Count Makes the Difference by Roger Bell_West.
9. The maximum difference by Simon Green.
GitHub Repository Stats
1. Commits: 43,454 (+97
)
2. Pull Requests: 11,991 (+36
)
3. Contributors: 259
4. Fork: 326
5. Stars: 189
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 - 320 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 #320.
Please find past solutions by respected guests. Please share your creative solutions in other languages.
Task 1: Distinct Average
Submitted by: Mohammad Sajid Anwar
You are given an array of numbers with even length.
Write a script to return the count of distinct average. The average is calculate by removing the minimum and the maximum, then average of the two.
Example 1
Input: @nums = (1, 2, 4, 3, 5, 6)
Output: 1
Step 1: Min = 1, Max = 6, Avg = 3.5
Step 2: Min = 2, Max = 5, Avg = 3.5
Step 3: Min = 3, Max = 4, Avg = 3.5
The count of distinct average is 1.
Example 2
Input: @nums = (0, 2, 4, 8, 3, 5)
Output: 2
Step 1: Min = 0, Max = 8, Avg = 4
Step 2: Min = 2, Max = 5, Avg = 3.5
Step 3: Min = 3, Max = 4, Avg = 3.5
The count of distinct average is 2.
Example 3
Input: @nums = (7, 3, 1, 0, 5, 9)
Output: 2
Step 1: Min = 0, Max = 9, Avg = 4.5
Step 2: Min = 1, Max = 7, Avg = 4
Step 3: Min = 3, Max = 5, Avg = 4
The count of distinct average is 2.
Task 2: Backspace Compare
Submitted by: Mohammad Sajid Anwar
You are given two strings containing zero or more #.
Write a script to return true if the two given strings are same by treating # as backspace.
Example 1
Input: $str1 = "ab#c"
$str2 = "ad#c"
Output: true
For first string, we remove "b" as it is followed by "#".
For second string, we remove "d" as it is followed by "#".
In the end both strings became the same.
Example 2
Input: $str1 = "ab##"
$str2 = "a#b#"
Output: true
Example 3
Input: $str1 = "a#b"
$str2 = "c"
Output: false
Last date to submit the solution 23:59 (UK Time) Sunday 18th May 2025
.