The Weekly Challenge - 136

Monday, Oct 25, 2021| 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: Two Friendly

10. TASK #2: Fibonacci Sequence


HEADLINES


What a week it was !!!


The Week #135 was special in many ways, please let me share the secrets. We breached the 100+ target once again, thanks to each and every members of Team PWC. Last time, we did it was in the Week #127. As far as guest contributions are concerned, the team didn’t disappoint us either. I aim for 50+ guest contributions, personally. Luckily last two weeks, we achieved the target. Most of the credit goes to Abigail when it comes to guest contributiobs. He does the bulk every week.


Anything else special happens last week?


Well, you all know, I used to contribute Raku solutions long time ago. I have also contributed in Swift as well. Last week, I finally decided to get back contributing in Raku. Not only that I contributed in Swift as well. I surprised myself by contributing in Python for the first time. I have been waiting for easy enough task to get my first contribution out. The Week #135 finally gave me the opportunity. I didn’t stop there and contributed Java solution as well. The end result of all these guest contributions, is I am back in the Top 20 guest contributors. I used to be in the Top 15 long time ago then I started slipping down. And at one time, I was dropped to 21st position. I am happy to find the positive energy in me. Fingers crossed, I hope it stays there for sometime. One thing that I wanted to do for months is that doing live coding session. I will do my best to get my hand dirty with some simple live coding. I really enjoy it. I have had many encouraging messages with regard to my live coding session. I would like to take this opportunity to thank all the subscribers for the support and encouragement.


Sunday morning didn’t start on happy note for me, why?


I lost my Sky Broadband connection. I panicked as it is so difficult to manage all the routine tasks without internet connection. I called the support team and they said some maintenance work is going on in my area. It would take around 24 hours to get the connection back. I immediately shared the news with the team on Twitter. The comments I received for my post brought smile back on my face. I loved the positivity among my friends on the various social platform. I am glad I choose the right people around me. Luckily I didn’t have to wait that long, I got the connection back around 10pm. Every member of my immediate family knows how busy I am on Sunday normally. I spent the afternoon watching the T20 World Cup 2021 match between India and Pakistan. The humiliating defeat of the Indian team really upset me. For the first time, my 11 year old daughter watched the match with me. To my surprise, she was supporting the Pakistan team. She was very happy to say the least in the end. Never mind, we will get the opportunity to take the glory back.


What else is going on?


Adam Russell and Cheok-Yin Fung, the two champions, came together started really interesting discussion. I would like to share this with the rest of team. Please let me know what do you think by your comments in the thread.


Raku contributions need an expert reviewer.


We have been waiting for a volunteer to help us review the Raku contributions just like how Colin Crain has been doing for Perl solutions. I don’t expect one person to do it all. Even if you can do it one or two weeks that would be great. Please let me know if you have spare time.


Anything else?


As you all know, we have dedicated space for Damian Conway and Andrew Shitov (our inhouse Raku expert and reviewer) every week in the weekly Recaps blog. I am thinking of adding one more to showcase the collection of Abigail regex magic. It is for my own benefit, so that I don’t have to look around anywher else. Right now, I am on a very tight schedule to fit this work. I was wondering, if anyone from the team can help me in this work.


Hacktoberfest is coming to an end soon.


You have one more week to participate in the ongoing the annual event and win a specially designed T-shirt. Mind you, it would be delivered to your door step for FREE anywhere in the world. If you are looking for ideas then why not take part in the weekly challenge and win the prize.


Blogs with Creative Title


1. Caught in the Middle With SEDOL by Adam Russell.

2. SEDOL in the Middle with Raku and Perl by Arne Sommer.

3. A Middling Thruppence? Do They Like Us At All? by Colin Crain.

4. Middle Digits to Validation: The Weekly Challenge #135 by Dave Jacoby.

5. Perl Weekly Challenge 135: Valid Middle by Roger Bell_West.


Let us share some interesting stats from the GitHub repository.

1. Commits: 20,732 (+190)

2. Pull Requests: 5,090 (+44)

3. Contributors: 180

4. Fork: 229 (+1)

5. Stars: 109 (+1)


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.


RECAP


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


PERL REVIEW


Please check out Perl solutions review of the “The Weekly Challenge - 132” 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


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 checkout the guest contributions for the Week #135.

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


TASK #1 › Two Friendly

Submitted by: Mohammad S Anwar

You are given 2 positive numbers, $m and $n.

Write a script to find out if the given two numbers are Two Friendly.

Two positive numbers, m and n are two friendly when gcd(m, n) = 2 ^ p where p > 0. The greatest common divisor (gcd) of a set of numbers is the largest positive number that divides all the numbers in the set without remainder.

Example 1

    Input: $m = 8, $n = 24
    Output: 1

    Reason: gcd(8,24) = 8 => 2 ^ 3

Example 2

    Input: $m = 26, $n = 39
    Output: 0

    Reason: gcd(26,39) = 13

Example 3

    Input: $m = 4, $n = 10
    Output: 1

    Reason: gcd(4,10) = 2 => 2 ^ 1

TASK #2 › Fibonacci Sequence

Submitted by: Mohammad S Anwar

You are given a positive number $n.

Write a script to find how many different sequences you can create using Fibonacci numbers where the sum of unique numbers in each sequence are the same as the given number.

Fibonacci Numbers: 1,2,3,5,8,13,21,34,55,89, …

Example 1

Input:  $n = 16
Output: 4

Reason: There are 4 possible sequences that can be created using Fibonacci numbers
i.e. (3 + 13), (1 + 2 + 13), (3 + 5 + 8) and (1 + 2 + 5 + 8).

Example 2

Input:  $n = 9
Output: 2

Reason: There are 2 possible sequences that can be created using Fibonacci numbers
i.e. (1 + 3 + 5) and (1 + 8).

Example 3

Input:  $n = 15
Output: 2

Reason: There are 2 possible sequences that can be created using Fibonacci numbers
i.e. (2 + 5 + 8) and (2 + 13).


Last date to submit the solution 23:59 (UK Time) Sunday 31st October 2021.


SO WHAT DO YOU THINK ?

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

Contact with me