The Weekly Challenge - 084

Monday, Oct 26, 2020| Tags: Perl, Raku

TABLE OF CONTENTS


1. HEADLINES

2. RECAP

3. PERL REVIEW

4. RAKU REVIEW

5. CHART

6. NEW MEMBERS

7. GUESTS

8. TASK #1: Reverse Integer

9. TASK #2: Find Square


HEADLINES


Congratulations Team PWC for crossing the magic number 6th times in a row, first time ever since the start of the journey.

Contributions Summary


Welcome PJ Durai and Stuart Little to the Team PWC.

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

Languages Summary


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

1) Commits: 10,693 (+251)

2) Pull Requests: 2,623 (+64)

3) Contributors: 140

4) Fork: 173 (+1)

5) Stars: 81 (+1)


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

RECAP


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


PERL REVIEW


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

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


RAKU REVIEW


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

If you missed any past reviews then please checkout 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


1) PJ Durai, an experienced Raku hacker.


2) Stuart Little, an experienced Perl/Raku hacker.

I am an amateur programmer (nothing but scripts for personal use); mostly Perl until recently, but with an increasing fascination for Raku. I expect I'd mostly be submitting Raku solutions.

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.


GUESTS


1) Frank Oosterhuis shared solution to Task #1 in Scala.

2) Kang-min Liu shared solutions to Task #1 and Task #2 in Python.

3) Myoungjin Jeon shared solutions to Task #1 and Task #2 in Go.

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

5) Nuno Vieira shared solutions to Task #1 and Task #2 in JavaScript.

6) Pete Houston shared solution to Task #1 in Awk.

7) Philip Hood shared solution to Task #1 in C.

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

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

10) Roger Bell_West shared solutions to Task #1 and Task #2 in Ruby.

11) Tyler Wardhaugh shared solutions to Task #1 and Task #2 in Clojure.

12) Tyler Wardhaugh shared solutions to Task #1 and Task #2 in Lua.

13) Shawn Wagn shared solutions to Task #1 and Task #2 in OCaml.

14) Shawn Wagner shared solutions to Task #1 and Task #2 in Tcl.

15) Ulrich Rieke shared solution to Task #1 in C++.

16) Ulrich Rieke shared solutions to Task #1 and Task #2 in Haskell.


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


TASK #1 › Reverse Integer

Submitted by: Mohammad S Anwar

You are given an integer $N.

Write a script to reverse the given integer and print the result. Print 0 if the result doesn’t fit in 32-bit signed integer.

The number 2,147,483,647 is the maximum positive value for a 32-bit signed binary integer in computing.

Example 1:

Input: 1234
Output: 4321

Example 2:

Input: -1234
Output: -4321

Example 3:

Input: 1231230512
Output: 0


TASK #2 › Find Square

Submitted by: Mohammad S Anwar

You are given matrix of size m x n with only 1 and 0.

Write a script to find the count of squares having all four corners set as 1.

Example 1:

Input: [ 0 1 0 1 ]
       [ 0 0 1 0 ]
       [ 1 1 0 1 ]
       [ 1 0 0 1 ]

Output: 1

Explanation:

There is one square (3x3) in the given matrix with four corners as 1 starts at r=1;c=2.

[ 1 0 1 ]
[ 0 1 0 ]
[ 1 0 1 ]

Example 2:

Input: [ 1 1 0 1 ]
       [ 1 1 0 0 ]
       [ 0 1 1 1 ]
       [ 1 0 1 1 ]

Output: 4

Explanation:

There is one square (4x4) in the given matrix with four corners as 1 starts at r=1;c=1.

There is one square (3x3) in the given matrix with four corners as 1 starts at r=1;c=2.

There are two squares (2x2) in the given matrix with four corners as 1. First starts at r=1;c=1 and second starts at r=3;c=3.

Example 3:

Input: [ 0 1 0 1 ]
       [ 1 0 1 0 ]
       [ 0 1 0 0 ]
       [ 1 0 0 1 ]

Output: 0


Last date to submit the solution 23:59 (UK Time) Sunday 1st November 2020.


SO WHAT DO YOU THINK ?

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

Contact with me