The Weekly Challenge - 077

Monday, Sep 7, 2020| Tags: Perl, Raku









8. TASK #1: Fibonacci Sum

9. TASK #2: Lonely X


Luca Ferrari, one of the most dedicated member of Team PWC shared this news with us in his last blog.

On the very next monday, September 7th, I will be in hospital for a new surgery on my (last) working right eye. In particular, I will be doing a trabeculectomy, and I’m pretty sure I will not be able to see anything for a couple of weeks, may be more. I hope my brain is not going to fail in the meantime!

This is heart breaking news. He has been regularly sharing the updates recently. I pray for his quick recovery.

It also reminds me of my own experience. Some of you might know about my eye sight trouble. The vision in my right eye is completely blurred, I noticed this just 2 weeks after my wedding, 17 years ago. I was told the damage is permanent and nothing can be done about it. It was very difficult moment for my wife. I somehow adjusted to the life with just one eye. Seven years later after that, I noticed it started affecting my other eye as well. I was put on high dose of steriod. I was on steriod for 3 years. As of today, I can’t see anything from my right eye. Left eye vision is slightly blurred but good enough for me to carry on routine work. I know how hard it must be for Luca and his family.

I pray for him and hope we get to hear good news soon.

I realised it is the first Monday of the month and time to declare the champion. With great pleasure, I announce Cheok-Yin Fung as the next champion. She joined the Team PWC in the Week #044 and has never missed a week since then. She is currently ranked #24 with contributions Perl: 60 and Blog: 19.

After 4 busy weeks, it was relatively quiet week. It was something expected. I also struggled with Word Search task. Somehow I got a working solution in Perl and Raku. Looking at others solution, for example, Neil Bowers, I feel like hiding under the blanket. I don’t have courage to face the world after the rubbish work I came up with. Having said that, I learnt a lot from others solutions. At one point, I decided not to share and embarrass myself. The only grace was my solution to the Prime Sum task in Perl and Raku. I am just hoping that I don’t get the beating by the reviewers Colin Crain and Andrew Shitov.

Dave Cross, an esteemed member of Team PWC wrote a blog about Git/GitHub to help new members joining the weekly challenge.

This week, we had guest contributions in 6 different languages. I would like to THANK each and every guest contributors.

1) Python: 4

2) Clojure: 2

3) Haskell: 2

4) Prolog: 2

5) Lisp: 1

6) Rust: 1

While we are talking about contributions, lets share some interesting stats from the GitHub repository.

1) Commits: 9122

2) Pull Requests: 2223

3) Contributors: 124

4) Fork: 154

5) Stars: 74

Last but not the least, I would like to thank each and every member for their support and encouragement.


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


Please checkout Perl solutions review of the “The Weekly Challenge - 075” by Colin Crain.

If you missed any past reviews then please checkout the collection.


Please checkout Raku solutions review of the “The Weekly Challenge - 075” by Andrew Shitov.

If you missed any past reviews then please checkout the collection.


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.



I like learning. I started writing things in Perl this year, starting with a simple CGI script at first. Started learning Emacs Lisp last week, Go last year & Perl this year.

With the above addition, we now have 185 members in the Team PWC.

Please find out How to contribute?, if you have any doubts.

Please give it a try to an excellent tool EZPWC created by respected member Saif Ahmed of Team PWC.


1) Adam Russell shared solutions to Task #1 and Task #2 in Prolog.

2) Jonas Berlin shared solution to Task #2 in Rust.

3) Lubos Kolouch shared solutions to Task #1 and Task #2 in Python.

4) Myoungjin Jeon shared solutions to Task #1 and Task #2 in Haskell.

5) Myoungjin Jeon shared solution to Task #2 in Lisp.

6) Roger Bell_West shared solutions to Task #1 and Task #2 in Python.

7) Tyler Wardhaugh shard solutions to Task #1 and Task #2 in Clojure.

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

TASK #1 › Fibonacci Sum

Submitted by: Mohammad S Anwar

You are given a positive integer $N.

UPDATE: 2020-09-07 09:00:00

Write a script to find out all possible combination of Fibonacci Numbers required to get $N on addition.

You are NOT allowed to repeat a number. Print 0 if none found.

Example 1:

Input: $N = 6

    1 + 2 + 3 = 6
    1 + 5 = 6

Example 2:

Input: $N = 9

    1 + 8 = 9
    1 + 3 + 5 = 9

TASK #2 › Lonely X

Submitted by: Mohammad S Anwar

You are given m x n character matrix consists of O and X only.

Write a script to count the total number of X surrounded by O only. Print 0 if none found.

Example 1:

Input: [ O O X ]
       [ X O O ]
       [ X O O ]

Output: 1 as there is only one X at the first row last column surrounded by only O.

Example 2:

Input: [ O O X O ]
       [ X O O O ]
       [ X O O X ]
       [ O X O O ]

Output: 2

    a) First  X found at Row 1 Col 3.

    b) Second X found at Row 3 Col 4.

Last date to submit the solution 23:59 (UK Time) Sunday 13th September 2020.


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

Contact with me