The Weekly Challenge - 193

Monday, Nov 28, 2022| Tags: Perl, Raku

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: Binary String

10. TASK #2: Odd String


HEADLINES


Welcome to the Week #193 of The Weekly Challenge.

Life is always full of ups & downs. As the year ending, I look back and noticed I missed so many things. I wanted to do so much but couldn’t get anywhere near. This year also we are going to do our own Advent Calendar. If you want your special blog post to be part of this year Advent Calendar then please do drop me a line. The general idea is I pick my favourite otherwise.

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

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

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

Today, we are giving away Coupon #16 to Simon Green for the book, Learning Perl Exercises by brian d foy. I will share the details with you in a separate email.

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.
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 62 guest contributions in 20 languages.

Here again, 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.

Last week, I could only find time to do just one task.


Task #1: Binary Flip     [Perl] [Raku] [Python] [Java] [Swift]

Binary Flip


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  (1214)
 2. Haskell (514)
 3. Ruby    (425)
 4. Lua     (411)
 5. C       (294)
 6. C++     (294)
 7. BQN     (267)
 8. Rust    (265)
 9. Go      (232)
10. Java    (209)

Blogs with Creative Title


1. Flipping to Redistribute by Adam Russell.

2. Flipped Equilibrium by Alexander Pankoff.

3. Equal Flip by Arne Sommer.

4. Frosting a cake without flipping the spatula by Bruce Gray.

5. Liberté, Égalité, Fraternité by Colin Crain.

6. The Counter to Equilibrium by Jorg Sommrey.

7. distribute and flip by Luca Ferrari.

8. Flipping easy and distributing fairly by Peter Campbell Smith.

9. Equal Flips For All by Roger Bell_West.


GitHub Repository Stats


1. Commits: 29,402 (+178)

2. Pull Requests: 7,162 (+45)

3. Contributors: 211

4. Fork: 267

5. Stars: 148



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.


RECAP


Quick recap of The Weekly Challenge - 192 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 #192.

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


Task 1: Binary String

Submitted by: Mohammad S Anwar

You are given an integer, $n > 0.

Write a script to find all possible binary numbers of size $n.

Example 1

Input: $n = 2
Output: 00, 11, 01, 10

Example 2

Input: $n = 3
Output: 000, 001, 010, 100, 111, 110, 101, 011

Task 2: Odd String

Submitted by: Mohammad S Anwar

You are given a list of strings of same length, @s.

Write a script to find the odd string in the given list. Use positional value of alphabet starting with 0, i.e. a = 0, b = 1, ... z = 25.

Find the difference array for each string as shown in the example. Then pick the odd one out.

Example 1:

Input: @s = ("adc", "wzy", "abc")
Output: "abc"

Difference array for "adc" => [ d - a, c - d ]
                           => [ 3 - 0, 2 - 3 ]
                           => [ 3, -1 ]

Difference array for "wzy" => [ z - w, y - z ]
                           => [ 25 - 22, 24 - 25 ]
                           => [ 3, -1 ]

Difference array for "abc" => [ b - a, c - b ]
                           => [ 1 - 0, 2 - 1 ]
                           => [ 1, 1 ]

The difference array for "abc" is the odd one.

Example 2:

Input: @s = ("aaa", "bob", "ccc", "ddd")
Output: "bob"

Difference array for "aaa" => [ a - a, a - a ]
                           => [ 0 - 0, 0 - 0 ]
                           => [ 0, 0 ]

Difference array for "bob" => [ o - b, b - o ]
                           => [ 14 - 1, 1 - 14 ]
                           => [ 13, -13 ]

Difference array for "ccc" => [ c - c, c - c ]
                           => [ 2 - 2, 2 - 2 ]
                           => [ 0, 0 ]

Difference array for "ddd" => [ d - d, d - d ]
                           => [ 3 - 3, 3 - 3 ]
                           => [ 0, 0 ]

The difference array for "bob" is the odd one.


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


SO WHAT DO YOU THINK ?

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

Contact with me