TABLE OF CONTENTS
01. HEADLINES
02. SPONSOR
03. RECAP
04. PERL REVIEW
05. RAKU REVIEW
06. CHART
07. NEW MEMBERS
08. GUESTS
09. TASK #1: Equal Pairs
10. TASK #2: DI String Match
HEADLINES
Welcome to the Week #249
of The Weekly Challenge
.
Merry Christmas
everyone !!!
I wish Team PWC
members great success in everything they do.
I pray new year brings good luck to all.
Please do enjoy quality time with your family and loved ones.
Advent Calendar 2023
Last 5 weeks
mainstream contribution stats. Thank you Team PWC
for your support and encouragements.
Week |
Perl |
Raku |
Blog |
244 |
55 | 36 | 29 |
245 |
53 | 30 | 28 |
246 |
43 | 26 | 23 |
247 |
42 | 21 | 22 |
248 |
50 | 29 | 24 |
Last 5 weeks
guest contribution stats. Thank you each and every guest contributors for your time and efforts.
Week |
Guests |
Contributions |
Languages |
244 |
14 | 56 | 17 |
245 |
16 | 53 | 18 |
246 |
10 | 39 | 14 |
247 |
10 | 37 | 14 |
248 |
10 | 41 | 13 |
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 (2065)
2. Ruby (634)
3. Haskell (615)
4. Lua (558)
5. Rust (482)
6. C (465)
7. C++ (450)
8. BQN (315)
9. Go (309)
10. JavaScript (303)
Blogs with Creative Title
1. Shortest Sub by Arne Sommer.
2. Tumbling Down The Rabbit Hole by Dave Jacoby.
3. Distances And Sums by Jorg Sommrey.
4. enjoy nested loops! by Luca Ferrari.
5. The Shortest Distance between Submatrix Sums by Packy Anderson.
6. Closet sum by Peter Campbell Smith.
7. Shortest Submatrix by Roger Bell_West.
8. A string, a character and a matrix… by Simon Green.
GitHub Repository Stats
1. Commits: 35,778 (+100
)
2. Pull Requests: 9,273 (+34
)
3. Contributors: 239
4. Fork: 301
5. Stars: 164
SPONSOR
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.
RECAP
Quick recap of The Weekly Challenge - 248 by Mohammad S 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 #248.
Please find past solutions by respected guests. Please share your creative solutions in other languages.
Task 1: Equal Pairs
Submitted by: Mohammad S Anwar
You are given an array of integers with even number of elements.
Write a script to divide the given array into equal pairs such that:
a) Each element belongs to exactly one pair.
b) The elements present in a pair are equal.
Example 1
Input: @ints = (3, 2, 3, 2, 2, 2)
Output: (2, 2), (3, 3), (2, 2)
There are 6 elements in @ints.
They should be divided into 6 / 2 = 3 pairs.
@ints is divided into the pairs (2, 2), (3, 3), and (2, 2) satisfying all the conditions.
Example 2
Input: @ints = (1, 2, 3, 4)
Output: ()
There is no way to divide @ints 2 pairs such that the pairs satisfy every condition.
Task 2: DI String Match
Submitted by: Mohammad S Anwar
You are given a string s
, consisting of only the characters "D"
and "I"
.
Find a permutation of the integers [0 .. length(s)]
such that for each character s[i]
in the string:
s[i] == 'I' ⇒ perm[i] < perm[i + 1]
s[i] == 'D' ⇒ perm[i] > perm[i + 1]
Example 1
Input: $str = "IDID"
Output: (0, 4, 1, 3, 2)
Example 2
Input: $str = "III"
Output: (0, 1, 2, 3)
Example 3
Input: $str = "DDI"
Output: (3, 2, 0, 1)
Last date to submit the solution 23:59 (UK Time) Sunday 31st December 2023.