The Weekly Challenge - 251

Monday, Jan 8, 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: Concatenation Value

10. TASK #2: Lucky Numbers


HEADLINES


Welcome to the Week #251 of The Weekly Challenge.

What a nice way to start the new year with two new members, Andrew Mehta and Mustafa Aydin joining the Team PWC. In fact, Andrew shared solution to Task #1 of Week #249. We had solutions to Week #250 in Raku and C++ by Mustafa Aydin.

I would like to thank Mark Anderson for sharing blogs after a long gap for Task #1 and Task #2.

Welcome back, Simon Proctor and thanks for your contributions in Raku.

Not sure how many of you are members of private Perl Programmers Group of Facebook. It gives me immense pleasure to see the discussion of weekly solutions by the senior members of Team PWC. You get to learn all nitty gritty just by following the discussions.

Looking back the history of weekly challenge, it has been such a pleasant journey. It wasn’t smooth all the way, I must admit but we all made through in the end. At the end of Week #250, we have the following members with the score of 2000+, not an easy task to be honest.


1. Laurent Rosenfeld (2452)

2. Roger Bell_West (2244)

3. Jaldhar H. Vyas (2140)

4. Luca Ferrari (2130)


There was a time when I was part of TOP 10 rank. My current rank #23 is still good but can be better. I hope in the new year 2024 will make the situation better to join the challenge. Right now I don’t feel mentally ready to take part in the weekly challenge.



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

  Week      Perl       Raku       Blog   
   246       43       26       23   
   247       42       21       22   
   248       50       29       24   
   249       51       24       23   
   250       56       34       27   

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

  Week      Guests       Contributions       Languages   
   246       10       39       14   
   247       10       37       14   
   248       10       41       13   
   249       12       46       14   
   250       16       82       23   

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     (2101)
 2. Ruby       (640)
 3. Haskell    (621)
 4. Lua        (564)
 5. Rust       (492)
 6. C          (469)
 7. C++        (458)
 8. BQN        (315)
 9. Go         (315)
10. JavaScript (307)

Blogs with Creative Title


1. String Index by Arne Sommer.

2. Leaping from Tree to Tree as They Float Down the Mighty Rivers of British Columbia by Dave Jacoby.

3. Alphanumeric Moduli by Jorg Sommrey.

4. the first one of 2024! by Luca Ferrari.

5. Two-Hundred Fifty Perl Weekly Challenges! Two-Hundred Fifty problems so clear… by Packy Anderson.

6. Smallest index, largest element by Peter Campbell Smith.

7. Smallest Viable Value by Roger Bell_West.

8. Small and large by Simon Green.


GitHub Repository Stats


1. Commits: 35,998 (+114)

2. Pull Requests: 9,351 (+43)

3. Contributors: 240 (+1)

4. Fork: 303 (+2)

5. Stars: 166 (+2)



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 2023. 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 2023. 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 - 250 by Mohammad S 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


1. Andrew Mehta, an experienced Perl hacker.

2. Mustafa Aydin, an experienced Raku hacker.


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

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


Task 1: Concatenation Value

Submitted by: Mohammad S Anwar

You are given an array of integers, @ints.

Write a script to find the concatenation value of the given array.

The concatenation of two numbers is the number formed by concatenating their numerals.

For example, the concatenation of 10, 21 is 1021.
The concatenation value of @ints is initially equal to 0.
Perform this operation until @ints becomes empty:

If there exists more than one number in @ints, pick the first element
and last element in @ints respectively and add the value of their
concatenation to the concatenation value of @ints, then delete the
first and last element from @ints.

If one element exists, add its value to the concatenation value of
@ints, then delete it.

Example 1

Input: @ints = (6, 12, 25, 1)
Output: 1286

1st operation: concatenation of 6 and 1 is 61
2nd operation: concaternation of 12 and 25 is 1225

Concatenation Value => 61 + 1225 => 1286

Example 2

Input: @ints = (10, 7, 31, 5, 2, 2)
Output: 489

1st operation: concatenation of 10 and 2 is 102
2nd operation: concatenation of 7 and 2 is 72
3rd operation: concatenation of 31 and 5 is 315

Concatenation Value => 102 + 72 + 315 => 489

Example 3

Input: @ints = (1, 2, 10)
Output: 112

1st operation: concatenation of 1 and 10 is 110
2nd operation: only element left is 2

Concatenation Value => 110 + 2 => 112

Task 2: Lucky Numbers

Submitted by: Mohammad S Anwar

You are given a m x n matrix of distinct numbers.

Write a script to return the lucky number, if there is one, or -1 if not.

A lucky number is an element of the matrix such that it is
the minimum element in its row and maximum in its column.

Example 1

Input: $matrix = [ [ 3,  7,  8],
                   [ 9, 11, 13],
                   [15, 16, 17] ];
Output: 15

15 is the only lucky number since it is the minimum in its row
and the maximum in its column.

Example 2

Input: $matrix = [ [ 1, 10,  4,  2],
                   [ 9,  3,  8,  7],
                   [15, 16, 17, 12] ];
Output: 12

Example 3

Input: $matrix = [ [7 ,8],
                   [1 ,2] ];
Output: 7


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


SO WHAT DO YOU THINK ?

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

Contact with me