Perl Weekly Challenge - 064

Monday, Jun 8, 2020| Tags: Perl, Raku


Two recent tragedies really upset me the most, first the killing of George Floyd and second the killing of pregnant elephant in India. All Life Matters, including Black. I try to keep my political views to select few and avoid sharing on social media. I hope I am not crossing the lines here.

The Week #062 was the dullest week ever earlier but thanks to all Team PWC members, it is no longer the least contributions week. The following Week #063 came with full force and looked very promising. It is very encouraging to see the energy among the members. So please keep it going and don’t forget to have fun all along.

I made an appeal few weeks ago for the help to clear the backlogs of Perl and Raku solutions reviews. I don’t expect one person to do it all. Even if you could do one that would be highly appreciated. Please pick a week and language of your choice. Once you have decided, please let us know before you start working on the reviews, so that no two persons work on the same week reviews. Please find the pending reviews weeks detail here. Thanks for your assistance.

Last week, we declared Shahed Nooshmand as Champion of the Month. I was pleasantly surprised to know that he is still a student and I must say, a bright student. Proud to have him in the team.

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


Quick recap of the “Perl Weekly Challenge - 063” by Mohammad S Anwar.


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


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.


Bartosz Jarzyna, an experienced Perl hacker from Lublin, Poland, joined 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.


Richard Park shared solutions to Task #1 and Task #2 in APL.

Sangeet Kar shared solutions to Task #1 and Task #2 in Python.

Ulrich Rieke shared solution to Task #2 in C++.

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

TASK #1 › Minimum Sum Path

Submitted by: Mohammad S Anwar
Reviewed by: Ryan Thompson

Given an m × n matrix with non-negative integers, write a script to find a path from top left to bottom right which minimizes the sum of all numbers along its path. You can only move either down or right at any point in time.



[ 1 2 3 ]
[ 4 5 6 ]
[ 7 8 9 ]

The minimum sum path looks like this:


Thus, your script could output: 21 ( 1 → 2 → 3 → 6 → 9 )

TASK #2 › Word Break

Submitted by: Mohammad S Anwar

You are given a string $S and an array of words @W.

Write a script to find out if $S can be split into sequence of one or more words as in the given @W.

Print the all the words if found otherwise print 0.

Example 1:


$S = "perlweeklychallenge"
@W = ("weekly", "challenge", "perl")


"perl", "weekly", "challenge"

Example 2:


$S = "perlandraku"
@W = ("python", "ruby", "haskell")


0 as none matching word found.

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


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

Contact with me