The Weekly Challenge - 194

Monday, Dec 5, 2022| Tags: Perl, Raku










09. TASK #1: Digital Clock

10. TASK #2: Frequency Equalizer


Welcome to the Week #194 of The Weekly Challenge.

Today is the first Monday of the month and time to declare our next champion. With great pleasure, we announce Bruce Gray as the next Champion of The Weekly Challenge. We don’t have the email address of Bruce, unfortunately. If you are reading this message then please share your email address with us.

Two new members joined the Team PWC last week, Thomas Köhler and David Ferrone. Welcome on board, we hope you enjoy the fun every week with us.

Advent Calendar 2022 is going on with full swing, thanks to the contributions by the members of Team PWC.

Day Article Authors
   1     Are Abecedarians from Abecedaria?     Adam Russell  
   2     Binary String / Odd String     James Smith  
   3     Counting Cute     Colin Crain  
   4     Four is Magic     Alexander Pankoff  
   5     Farey, Moebius     Arne Sommer  

Another busy week with 100+ contributions. This is the record in the history of The Weekly Challenge, we achieved the target for the 10th consecutive weeks. Thank you Team PWC for the support and encouragement.

  Week      184       185       186       187       188       189       190       191       192       193  
Perl 57 61 58 51 63 62 55 56 59 58
Raku 31 35 33 34 36 35 32 38 41 31
Blog 17 19 20 20 16 18 23 21 23 21

Last week, we had 39 regular contributors and 12 guest contributors. Thank you everyone for the support and encouragement.

Today, we are giving away Coupon #17 to Robbie Hatley for the book, Learning Perl Exercises by brian d foy. Unfortunately we don’t have your email address, can you please share with us so that we can send you the coupon?

Past Winners

  S. No.   Name S. No. Name
1. Cheok-Yin Fung 2. W. Luis Mochan
3. Robert DiCicco 4. Kueppo Wesley
5. Solathian 6. Dario Mazzeo
7.   Peter Campbell Smith   8. Kjetil Skotheim
9. Neils van Dijke 10.   Laurent Rosenfeld  
11. Duncan C. White 12. Ali Moradi
13. Jorg Sommrey 14. James Smith
15. Alexander Pankoff 16. Simon Green
17. 18.
19. 20.
21. 22.
23. 24.
25. 26.
27. 28.
29. 30.
31. 32.
33. 34.
35. 36.
37. 38.
39. 40.
41. 42.
43. 44.
45. 46.
47. 48.
49. 50.

I would like to thank every guest contributors for making it special every week. Last week we received 43 guest contributions in 15 languages.

Please checkout the blog post by E. Alvarez. Being a guest contributor, it doesn’t get space in the Weekly Recaps sections, so I decided to mention it here.

TOP 10 Guest Languages

Rust moved up one position to rank #7.

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  (1226)
 2. Haskell (516)
 3. Ruby    (429)
 4. Lua     (413)
 5. C       (296)
 6. C++     (296)
 7. Rust    (269)
 8. BQN     (267)
 9. Go      (233)
10. Java    (209)

Blogs with Creative Title

1. An Abundance of Strings by Arne Sommer.

2. evens and Oddballs by Bruce Gray.

3. What An Unusual String You Have There! Or Are You Just Glad To Meet Me? by Colin Crain.

4. Map, map and remap! by Luca Ferrari.

5. All the binaries and find the odd man out by Peter Campbell Smith.

6. Odd Binary by Roger Bell_West.

7. The odd binary string by Simon Green.

GitHub Repository Stats

1. Commits: 29,547 (+145)

2. Pull Requests: 7,199 (+37)

3. Contributors: 213 (+2)

4. Fork: 268 (+1)

5. Stars: 149 (+1)

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 2022. 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 2022. 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 - 193 by Mohammad S Anwar.


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.


Thomas Köhler, an experienced Perl hacker from Germany joined the Team PWC.

David Ferrone, an experienced Perl hacker from New England, USA 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 check out the guest contributions for the Week #193.

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

Task 1: Digital Clock

Submitted by: Mohammad S Anwar

You are given time in the format hh:mm with one missing digit.

Write a script to find the highest digit between 0-9 that makes it valid time.

Example 1

Input: $time = '?5:00'
Output: 1

Since 05:00 and 15:00 are valid time and no other digits can fit in the missing place.

Example 2

Input: $time = '?3:00'
Output: 2

Example 3

Input: $time = '1?:00'
Output: 9

Example 4

Input: $time = '2?:00'
Output: 3

Example 5

Input: $time = '12:?5'
Output: 5

Example 6

Input: $time =  '12:5?'
Output: 9

Task 2: Frequency Equalizer

Submitted by: Mohammad S Anwar

You are given a string made of alphabetic characters only, a-z.

Write a script to determine whether removing only one character can make the frequency of the remaining characters the same.

Example 1:

Input: $s = 'abbc'
Output: 1 since removing one alphabet 'b' will give us 'abc' where each alphabet frequency is the same.

Example 2:

Input: $s = 'xyzyyxz'
Output: 1 since removing 'y' will give us 'xzyyxz'.

Example 3:

Input: $s = 'xzxz'
Output: 0 since removing any one alphabet would not give us string with same frequency alphabet.

Last date to submit the solution 23:59 (UK Time) Sunday 11th December 2022.


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

Contact with me