The Weekly Challenge - 263

Monday, Apr 1, 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: Target Index

10. TASK #2: Merge Items


HEADLINES


Welcome to the Week #263 of The Weekly Challenge.

Let us all welcome, Reinier Maliepaard from Netherlands to Team PWC. He shared solutions to the Week 260 and Week 262.

We have interviewed champion Nelo Tovar finally. Thank you, Nelo for sharing your experience with us.

Today is the first Monday of the month and time to declare our next champion. I proudly announce, Asher Harvey-Smith, as our Champion of the Month. He is an experienced hacker from England and has so far shared solutions in Raku, APL, BQN, Haskell and J,

Thank you, Lance Wicks, for yet another contributions in Perl and Roc.



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

  Week      Perl       Raku       Blog   
   258       56       38       30   
   259       41       19       22   
   260       50       28       27   
   261       55       32       25   
   262       59       32       25   

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

  Week      Guests       Contributions       Languages   
   258       17       67       19   
   259       13       44       17   
   260       14       56       17   
   261       18       79       24   
   262       18       80       24   

TOP 10 Guest Languages


Last week Rust moved up one rank to #4. Congratulation to all Rust contributors.

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     (2380)
 2. Ruby       (667)
 3. Haskell    (646)
 4. Rust       (591)
 5. Lua        (588)
 6. C          (523)
 7. C++        (493)
 8. JavaScript (384)
 9. Go         (345)
10. BQN        (326)

Blogs with Creative Title


1. Positively Equal by Arne Sommer.

2. Grep it once, grep it twice by Bob Lied.

3. Positive, Negative or Divisible? by Jorg Sommrey.

4. another short one! by Luca Ferrari.

5. Counting to the Max! by Packy Anderson.

6. Plus versus minus by Peter Campbell Smith.

7. Count Max, Type O Negative by Roger Bell_West.

8. The maximum divisible by Simon Green.


GitHub Repository Stats


1. Commits: 37,385 (+105)

2. Pull Requests: 9,830 (+37)

3. Contributors: 243

4. Fork: 306

5. Stars: 170



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 - 262 by Mohammad Sajid Anwar.


PERL REVIEW


If you missed any past reviews then please check out the collection.


RAKU REVIEW


Please checkout Raku solutions review of The Weekly Challenge - 262 by Andrew Shitov.

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

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


Task 1: Target Index

Submitted by: Mohammad Sajid Anwar

You are given an array of integers, @ints and a target element $k.

Write a script to return the list of indices in the sorted array where the element is same as the given target element.

Example 1

Input: @ints = (1, 5, 3, 2, 4, 2), $k = 2
Output: (1, 2)

Sorted array: (1, 2, 2, 3, 4, 5)
Target indices: (1, 2) as $ints[1] = 2 and $ints[2] = 2

Example 2

Input: @ints = (1, 2, 4, 3, 5), $k = 6
Output: ()

No element in the given array matching the given target.

Example 3

Input: @ints = (5, 3, 2, 4, 2, 1), $k = 4
Output: (4)

Sorted array: (1, 2, 2, 3, 4, 5)
Target index: (4) as $ints[4] = 4

Task 2: Merge Items

Submitted by: Mohammad Sajid Anwar

You are given two 2-D array of positive integers, $items1 and $items2 where element is pair of (item_id, item_quantity).

Write a script to return the merged items.

Example 1

Input: $items1 = [ [1,1], [2,1], [3,2] ]
       $items2 = [ [2,2], [1,3] ]
Output: [ [1,4], [2,3], [3,2] ]

Item id (1) appears 2 times: [1,1] and [1,3]. Merged item now (1,4)
Item id (2) appears 2 times: [2,1] and [2,2]. Merged item now (2,3)
Item id (3) appears 1 time: [3,2]

Example 2

Input: $items1 = [ [1,2], [2,3], [1,3], [3,2] ]
       $items2 = [ [3,1], [1,3] ]
Output: [ [1,8], [2,3], [3,3] ]

Example 3

Input: $items1 = [ [1,1], [2,2], [3,3] ]
       $items2 = [ [2,3], [2,4] ]
Output: [ [1,1], [2,9], [3,3] ]


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


SO WHAT DO YOU THINK ?

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

Contact with me