The Weekly Challenge - 187

Monday, Oct 17, 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: Days Together

10. TASK #2: Magical Triplets


HEADLINES


Welcome to the Week #187 of The Weekly Challenge.

Please welcome izem to the Team PWC. Thanks izem for your first contributions in Perl and Python.

We are into the third week of Hacktoberfest 2022. I am not surprised the rise of popularity of The Weekly Challenge. Three weeks in a row, we recceived 100+ contributions. Please find below the weekly contributions breakdown.

Week #1

Perl: 55
Raku: 31
Blog: 17

Week #2

Perl: 59
Raku: 35
Blog: 19

Week #3

Perl: 56
Raku: 33
Blog: 20

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

Kjetil Skotheim if you are reading this message, please get in touch with us so that we can send the FREE token for the book.

Today, we are giving away Token #10 to Laurent Rosenfeld for the book, Learning Perl Exercises by brian d foy. I will share the details with you in a separate email.


Past Winners

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

Recently joined guest Joao Felipe shared blog post for the first time. Thank you.

My contributions to the Task #1: Zip List of the Week #186 in Perl, Raku and Python.


Zip List


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  (1134)
 2. Haskell (500)
 3. Ruby    (402)
 4. Lua     (390)
 5. C       (274)
 6. C++     (274)
 7. BQN     (261)
 8. Rust    (239)
 9. Go      (226)
10. Node.js (194)

Blogs with Creative Title


1. Zippy Fast Dubious OCR Process by Adam Russell.

2. Unicode Zip by Arne Sommer.

3. zip and unicode by Luca Ferrari.

4. Merge like a zip and Unidecode by Peter Campbell Smith.

5. Makeover List by Roger Bell_West.


GitHub Repository Stats


1. Commits: 28,460 (+177)

2. Pull Requests: 6,912 (+44)

3. Contributors: 208 (+2)

4. Fork: 265 (+2)

5. Stars: 144



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


PERL REVIEW


Please check out Perl solutions review of The Weekly Challenge - 180 by Colin Crain.

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


izem, an experienced Perl and Python 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.


GUESTS


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

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


Task 1: Days Together

Submitted by: Mohammad S Anwar

Two friends, Foo and Bar gone on holidays seperately to the same city. You are given their schedule i.e. start date and end date.

To keep the task simple, the date is in the form DD-MM and all dates belong to the same calendar year i.e. between 01-01 and 31-12. Also the year is non-leap year and both dates are inclusive.

Write a script to find out for the given schedule, how many days they spent together in the city, if at all.

Example 1

Input: Foo => SD: '12-01' ED: '20-01'
       Bar => SD: '15-01' ED: '18-01'

Output: 4 days

Example 2

Input: Foo => SD: '02-03' ED: '12-03'
       Bar => SD: '13-03' ED: '14-03'

Output: 0 day

Example 3

Input: Foo => SD: '02-03' ED: '12-03'
       Bar => SD: '11-03' ED: '15-03'

Output: 2 days

Example 4

Input: Foo => SD: '30-03' ED: '05-04'
       Bar => SD: '28-03' ED: '02-04'

Output: 4 days

Task 2: Magical Triplets

Submitted by: Mohammad S Anwar

You are given a list of positive numbers, @n, having at least 3 numbers.

Write a script to find the triplets (a, b, c) from the given list that satisfies the following rules.

1. a + b > c
2. b + c > a
3. a + c > b
4. a + b + c is maximum.

In case, you end up with more than one triplets having the maximum then pick the triplet where a >= b >= c.


Example 1

    Input: @n = (1, 2, 3, 2);
    Output: (3, 2, 2)

Example 2

    Input: @n = (1, 3, 2);
    Output: ()

Example 3

    Input: @n = (1, 1, 2, 3);
    Output: ()

Example 4

    Input: @n = (2, 4, 3);
    Output: (4, 3, 2)


Last date to submit the solution 23:59 (UK Time) Sunday 23rd October 2022.


SO WHAT DO YOU THINK ?

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

Contact with me