The Weekly Challenge - 137

Monday, Nov 1, 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: Long Year

10. TASK #2: Lychrel Number


HEADLINES



Let us welcome November with a bang !!!


Today is the first Monday of the month and it is the time to declare the champion of the weekly challenge.


Paulo Custodio


With great pleasure, I announce, Paulo Custodio as the champion. As of today, he is ranked #24 with score 354 in the leader board. He is also ranked #3 with score 402 in the guest leader board. He is a regular contributor in Perl as well as Ada, Adb, Awk, Basic, Bc, Brainfuck, C, C++, D, Forth, Fortran, Lua, Pascal and Python.


Time to welcome new members


  1. Karishma Rajput joined the team as guest with contributions in C, C++ and JavaScript.

  2. Robert DiCicco, from Little Rock, AR, joined the Team PWC as a Perl Hacker. He shared his solution in Perl.


Am I being superactive in the last 2 weeks?


In terms of guest contributions, I would say, yes. I have been contributing Perl solutions to Task #1 or Task #2 or both sometimes. I have even dared to start contributing in Raku well. But the most excitement bit is that I am back on guest contributions category too. In the last 2 weeks, I have translated Perl solutions to Java, Python and Swift. This has brought me back in the Top 20 guest contributors.


But then came a moment …


I had my booster jab last Wednesday. The jab took me down the very next day. I was on the bed with high temperature. I had to take off sick from work. Friday was better but not fully functional. I kept myself invovled only in office related tasks. Saturday was the worst day, temperature going up and down. I was thinking, was it good idea to take the booster jab? In fact, the first two jabs didn’t do anything terrible. So I was hoing this would also go without much trouble. Here I was wrong. Life is so unpredictable. I was still unwell on Sunday. But I was looking forward to the T20 World Cup match between India and New Zealand in the second half of Sunday. It was kind of quater final match and India lost it very badly. Can you imagine? The loss didn’t lift my mood as I was already feeling down.


Then I decided …


Enough is enough, I have to push myself and start processing all the pending Pull Requests from the Team PWC. I started at 8pm and finished at midnight. It was time to prepare the Perl Weekly Newsletter. As some of you know, I am also co-editor of the weekly newsletter, Gabor Szabo, being the chief editor. I submitted the draft at about 5am. Then I started preparing for the new weekly challenge. This is the whole Sunday night story for me.


New ideas?


Just a gentle reminder, the two champions, Adam Russell and Cheok-Yin Fung, started a discussion on new ideas for the weekly challenge. Please join them and share your views also. You can find the details here.


Blogs with Creative Title


1. Friendly Fibonacci Summands by Adam Russell.

2. Friendly Fibonacci with Raku and Perl by Arne Sommer.

3. Don’t Get Too Friendly — It’s a Series of Lies by Colin Crain.

4. The Sequential Friendly Book: The Weekly Challenge #136 by Dave Jacoby.

5. Perl Weekly Challenge 136: Fibonacci Friends by Roger Bell_West.


Let us share some interesting stats from the GitHub repository.

1. Commits: 20,932 (+200)

2. Pull Requests: 5,133 (+43)

3. Contributors: 181 (+)

4. Fork: 231 (+2)

5. Stars: 109


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


PERL REVIEW


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


Karishma Rajput joined team as guest.


Robert DiCicco, a Perl hacker from Little Rock, AR.


I have not programmed anything in perl in about 8 years. I have recently restarted and this is the first thing I have done.


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 #136.

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


TASK #1 › Long Year

Submitted by: Mohammad S Anwar

Write a script to find all the years between 1900 and 2100 which is a Long Year.

A year is Long if it has 53 weeks.


[UPDATED][2021-11-01 16:20:00]: For more information about Long Year, please refer to wikipedia.

Expected Output

1903, 1908, 1914, 1920, 1925,
1931, 1936, 1942, 1948, 1953,
1959, 1964, 1970, 1976, 1981,
1987, 1992, 1998, 2004, 2009,
2015, 2020, 2026, 2032, 2037,
2043, 2048, 2054, 2060, 2065,
2071, 2076, 2082, 2088, 2093,
2099

TASK #2 › Lychrel Number

Submitted by: Mohammad S Anwar

You are given a number, 10 <= $n <= 1000.

Write a script to find out if the given number is Lychrel number. To keep the task simple, we impose the following rules:

a. Stop if the number of iterations reached 500.
b. Stop if you end up with number >= 10_000_000.

[UPDATED][2021-11-01 16:20:00]: If you stop because of any of the above two rules then we expect 1 as an output.

According to wikipedia:

A Lychrel number is a natural number that cannot form a palindrome through the iterative process of repeatedly reversing its digits and adding the resulting numbers.

Example 1

Input: $n = 56
Output: 0

After 1 iteration, we found palindrome number.
56 + 65 = 121

Example 2

Input: $n = 57
Output: 0

After 2 iterations, we found palindrome number.
 57 +  75 = 132
132 + 231 = 363

Example 3

Input: $n = 59
Output: 0

After 3 iterations, we found palindrome number.
 59 +  95 =  154
154 + 451 =  605
605 + 506 = 1111


Last date to submit the solution 23:59 (UK Time) Sunday 7th November 2021.


SO WHAT DO YOU THINK ?

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

Contact with me