The Weekly Challenge - 267

Monday, Apr 29, 2024| 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: Product Sign

10. TASK #2: Line Counts


HEADLINES


Welcome to the Week #267 of The Weekly Challenge.

I would like to thank, Lance Wicks, for yet another contribution in Perl.

Jorg Sommrey pointed out that we have finally reached the 1000th pull request by Peter Meszaros.

Well done Team PWC, keep it up great work.



Last 5 weeks mainstream contribution stats. Thank you Team PWC for your support and encouragements.

  Week      Perl       Raku       Blog   
   262       59       32       25   
   263       61       34       28   
   264       50       34       26   
   265       54       32       26   
   266       55       29       24   

Last 5 weeks guest contribution stats. Thank you each and every guest contributors for your time and efforts.

  Week      Guests       Contributions       Languages   
   262       18       80       24   
   263       19       79       23   
   264       14       66       20   
   265       12       52       16   
   266       12       53       16   

TOP 10 Guest Languages


Do you see your favourite language in the Top #10? If not then why not contribute regularly and make it to the top.

 1. Python     (2460)
 2. Ruby       (676)
 3. Haskell    (658)
 4. Rust       (616)
 5. Lua        (596)
 6. C          (532)
 7. C++        (502)
 8. JavaScript (402)
 9. Go         (355)
10. BQN        (331)

Blogs with Creative Title


1. Uncommon as X by Arne Sommer.

2. Uncommon Shapes by Jorg Sommrey.

3. words and matrix indexes by Luca Ferrari.

4. A Matrix of Uncommon X Words by Packy Anderson.

5. Solo words and a cross matrix by Peter Campbell Smith.

6. X, the Uncommon by Roger Bell_West.

7. Uncommon matrix by Simon Green.


GitHub Repository Stats


1. Commits: 37,835 (+113)

2. Pull Requests: 9,991 (+31)

3. Contributors: 243

4. Fork: 308

5. Stars: 171



In the year 2024, we are looking for new sponsor for monthly winner. If anyone interested please get in touch with us at perlweeklychallenge@yahoo.com. Thanks for your support in advance.


RECAP


Quick recap of The Weekly Challenge - 266 by Mohammad Sajid Anwar.


PERL REVIEW


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 check out the guest contributions for the Week #266.

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


Task 1: Product Sign

Submitted by: Mohammad Sajid Anwar

You are given an array of @ints.

Write a script to find the sign of product of all integers in the given array. The sign is 1 if the product is positive, -1 if the product is negative and 0 if product is zero.

Example 1

Input: @ints = (-1, -2, -3, -4, 3, 2, 1)
Output: 1

The product -1 x -2 x -3 x -4 x 3 x 2 x 1 => 144 > 0

Example 2

Input: @ints = (1, 2, 0, -2, -1)
Output: 0

The product 1 x 2 x 0 x -2 x -1 => 0

Example 3

Input: @ints = (-1, -1, 1, -1, 2)
Output: -1

The product -1 x -1 x 1 x -1 x 2 => -2 < 0

Task 2: Line Counts

Submitted by: Mohammad Sajid Anwar

You are given a string, $str, and a 26-items array @widths containing the width of each character from a to z.

Write a script to find out the number of lines and the width of the last line needed to display the given string, assuming you can only fit 100 width units on a line.

Example 1

Input: $str = "abcdefghijklmnopqrstuvwxyz"
       @widths = (10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10)
Output: (3, 60)

Line 1: abcdefghij (100 pixels)
Line 2: klmnopqrst (100 pixels)
Line 3: uvwxyz (60 pixels)

Example 2

Input: $str = "bbbcccdddaaa"
       @widths = (4,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10)
Output: (2, 4)

Line 1: bbbcccdddaa (98 pixels)
Line 2: a (4 pixels)


Last date to submit the solution 23:59 (UK Time) Sunday 5th May 2024.


SO WHAT DO YOU THINK ?

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

Contact with me