The Weekly Challenge - 124

Monday, Aug 2, 2021| Tags: Perl, Raku










09. TASK #1: Happy Women Day

10. TASK #2: Tug of War


Welcome to the first Monday of the month and as you all know, it is the time of the month when I pick a champion among the Team PWC. With great pride, I announce Flavio Poletti as the next Champion of the weekly challenge. I have known Flavio long before he joined the Team PWC as someone who blog daily on Perl topics. Being the co-editor of Perl Weekly newsletter I would always look for his blog posts so that it can be part of the weekly newsletter. It is not easy to write daily blog without break for more than a year now. Flavio started with Perl contributions but later he started sharing Raku code. For the last few weeks, both Perl and Raku become his regulars. As of today, Flavio is ranked #19 with the total score of 418.

Welcome back, Jonas Berlin and thanks for your contributions in Rust.

Lucas Ransan, once again introduced a new programming language, C3 to Team PWC. In total, he introduced 7 new programming languages i.e. C3, Coconut, Miranda, Myrddin, Nix, Odin and Zig. He is also regular contributors of Raku solutions (14).

I would like to talk about Cheok-Yin Fung, one of the biggest supporter of the weekly challenge. I still remember when she joined the team she was raw learning the language, Perl, being one of them. It makes me proud to see how quickly she became a confident Perl programmer. I have also noticed the writing skill has improved a lot. You should definitely checkout her recent blogs. Well done, Cheok-Yin, keep up the great work.

It is not hidden from anyone that I am a big fan of Arne Sommer specially his blogging skill. His choice of blog title and header image are one of the best. Please keep sharing your knowledge and experience with us.

For me last week was the busiest, I did long pending YouTube videos for the past week challenges. After a long time, I attempted to solve both tasks this week. I remember when I finished coding Square Points task, I had two test case from the example. I knew it is not enough and wanted more. I didn’t have the energy to come up with good edge case to test my code. In the past, I have always got the help from E. Choroba. He is one of the few members who would have complete set of test cases. So I nicked the unit test case from him, sorry. As soon as I ran my code against the new set of test case, I got 3 failed test. I had to fix my code to make all test pass. Thank you, E. Choroba for your guidance. I am sure with time, I can be as good as you are today.

I know I am guilty of not participating regularly in the weekly challenge but, trust me, I do my best. Every time I do, I share it with my friends on Facebook, Twitter and LinkedIn. I used to share it on Reddit too but then I realised I am not strong enough to face the Reddit crowd. For me, Facebook, was only meant for entertainment and personal use. Little a while ago, someone don’t remember who, either Dave Cross or Curtis Poe invited me to join Facebook group, The Perl Community. Well, do you think, I can say no to either of them? I happily accepted the offer and later became Moderator of the group. A few weeks later, I got the invitation from Will Braswell to join another Facebook group, Perl Programmers, a private group. I was made Moderator of this group as well, thanks to Will Braswell. Those who are members of these two Facebook groups would have noticed that I share my post to both groups. Sometimes, I share my own contributions to the weekly challenge i.e. code or video and sometimes I share others code if I like, do you remember, Abigail regex magic that I shared.

So why am I discussing about Facebook today?

Someone, don’t want to name, made a comment to my recent Facebook post that I post too much on Facebook and they have very low SNR, Signal to Noise Ration. Honestly I didn’t know about such term before. Also my post are low quality. I accept I am not as smart as many others but I am learning even today after spending 22 years in the industry. Few days back, I saw Twitter post by Gabor Szabo, one who I idolise, saying he has decided to avoid visiting Facebook. After the comment about my post on Facebook, I have had enough and thinking of stop sharing post on Facebook i.e. both groups. I will make a final decision in the next few days. I am going to miss some very close friends who always encourage me. Mind you, they are not part of Team PWC but always first to like my post. And then there are some from Team PWC active on Facebook and I do receive kind words from them too. By the way, long time ago, I created Facebook group, The Weekly Challenge - Perl & Raku. I have been posting my weekly challenge related post there too. Although, we don’t have too many members at the moment, I am thinking of keeping my post to this group only, so to avoid any confrontation. More on this subject in my next monthly report to be made public soon.

I would like to end the conversation on happy note with the post from Jared Martin.

Mohammad Anwar: Swap Odd/Even bits (Week: 120)

Mohammad Anwar: Clock Angle (Week: 120)

Mohammad Anwar: Invert Bit (Week: 121)

Mohammad Anwar: Average of Stream (Week: 122)

Let us share some interesting stats from the GitHub repository.

1. Commits: 18,932 (+180)

2. Pull Requests: 4,641 (+45)

3. Contributors: 171

4. Fork: 217 (+1)

5. Stars: 97

Last but not least, I would like to thank each and every member for their support and encouragement.

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 2021. 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 2021. 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.


Quick recap of “The Weekly Challenge - 123” by Mohammad S Anwar.


Please check out Perl solutions review of the “The Weekly Challenge - 121” by Colin Crain.

If you missed any past reviews then please check out the collection.


If you missed any past reviews then please check out the collection.


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.


@kjetillll, Perl hacker, joined the 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.


Please checkout the guest contributions for the Week #123.

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

TASK #1 › Happy Women Day

Submitted by: Mohammad S Anwar

Write a script to print the Venus Symbol, international gender symbol for women. Please feel free to use any character.

   ^     ^
  ^       ^
 ^         ^
 ^         ^
 ^         ^
 ^         ^
 ^         ^
  ^       ^
   ^     ^

TASK #2 › Tug of War

Submitted by: Mohammad S Anwar

You are given a set of $n integers (n1, n2, n3, ….).

Write a script to divide the set in two subsets of n/2 sizes each so that the difference of the sum of two subsets is the least. If $n is even then each subset must be of size $n/2 each. In case $n is odd then one subset must be ($n-1)/2 and other must be ($n+1)/2.


Input:        Set = (10, 20, 30, 40, 50, 60, 70, 80, 90, 100)
Output:  Subset 1 = (30, 40, 60, 70, 80)
         Subset 2 = (10, 20, 50, 90, 100)

Input:        Set = (10, -15, 20, 30, -25, 0, 5, 40, -5)
         Subset 1 = (30, 0, 5, -5)
         Subset 2 = (10, -15, 20, -25, 40)

Last date to submit the solution 23:59 (UK Time) Sunday 8th August 2021.


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

Contact with me