The Weekly Challenge - 199

Monday, Jan 9, 2023| 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: Good Pairs

10. TASK #2: Good Triplets


HEADLINES


Welcome to the Week #199 of The Weekly Challenge.

Last week, another new member, Rawley Fowler, joined the Team PWC from Canada. We are now a family of 280 members.

With the start of new year, I feel little tired. In 2 months time, we would be 4 years old. It is not easy to keep the same energy level every week for so long. Having said, every time I receive an appreciation from the team members, I am back fully charged.

There is a good news with the new year, Perl Careers has agreed to continue our solo sponsor in the Year 2023. Thank you Pete for the support and encouragements. Immediately after this news, I had another email from one of the member of Team PWC enquiring about what can be done to bring back the weekly champions. I am really happy that somebody is even thinking about it. It would be nice if we can go back to the original format in the Year 2023.

Today, we are giving away Coupon #22 to Adam Russell 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.  Simon Green
17.  Robbie Hatley 18.  Bob Lied
19.  Athanasius 20.  David Ferrone
21.  Thomas Kohler 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.

We missed the target in the Week 197 after 13 weeks but then we are back again on the target in the Week 198. Thank you Team PWC.

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

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


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  (1270)
 2. Haskell (525)
 3. Ruby    (445)
 4. Lua     (431)
 5. C++     (311)
 6. C       (310)
 7. Rust    (292)
 8. BQN     (267)
 9. Go      (233)
10. Java    (214)

Blogs with Creative Title


1. Prime the Gaps! by Adam Russell.

2. Prime the Gap by Arne Sommer.

3. Mind The Gap by Dave Jacoby.

4. First Perl Code of the Year! by Luca Ferrari.

5. Mind the gap! by Peter Campbell Smith.

6. Count Max by Roger Bell_West.


GitHub Repository Stats


1. Commits: 30,109 (+129)

2. Pull Requests: 7,373 (+42)

3. Contributors: 215

4. Fork: 273 (+2)

5. Stars: 150



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 - 198 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


Rawley Fowler, an experienced Raku hacker from Canada 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.


GUESTS


Please check out the guest contributions for the Week #198.

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


Task 1: Good Pairs

Submitted by: Mohammad S Anwar

You are given a list of integers, @list.

Write a script to find the total count of Good Pairs.


A pair (i, j) is called good if list[i] == list[j] and i < j.


Example 1

Input: @list = (1,2,3,1,1,3)
Output: 4

There are 4 good pairs found as below:
(0,3)
(0,4)
(3,4)
(2,5)

Example 2

Input: @list = (1,2,3)
Output: 0

Example 3

Input: @list = (1,1,1,1)
Output: 6

Good pairs are below:
(0,1)
(0,2)
(0,3)
(1,2)
(1,3)
(2,3)

Task 2: Good Triplets

Submitted by: Mohammad S Anwar

You are given an array of integers, @array and three integers $x,$y,$z.

Write a script to find out total Good Triplets in the given array.

A triplet array[i], array[j], array[k] is good if it satisfies the following conditions:

a) 0 <= i < j < k <= n (size of given array)
b) abs(array[i] - array[j]) <= x
c) abs(array[j] - array[k]) <= y
d) abs(array[i] - array[k]) <= z

Example 1

Input: @array = (3,0,1,1,9,7) and $x = 7, $y = 2, $z = 3
Output: 4

Good Triplets are as below:
(3,0,1) where (i=0, j=1, k=2)
(3,0,1) where (i=0, j=1, k=3)
(3,1,1) where (i=0, j=2, k=3)
(0,1,1) where (i=1, j=2, k=3)

Example 2

Input: @array = (1,1,2,2,3) and $x = 0, $y = 0, $z = 1
Output: 0


Last date to submit the solution 23:59 (UK Time) Sunday 15th January 2023.


SO WHAT DO YOU THINK ?

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

Contact with me