The Weekly Challenge - 284

Monday, Aug 26, 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: Lucky Integer

10. TASK #2: Relative Sort


HEADLINES


Welcome to the Week #284 of The Weekly Challenge.

Last week we had another member, Peter Meszaros joining Paulo Custodio dealing with past week challenges. It gives me immense pleasure to see the flood of regular contributions. Thank you for your continuous support and contributions.

Thank you, Reinier Maliepaard, for sharing the special ChatGPT version of the Task #1.

I noticed a very close fight between Ruby and Rust as they are the second most favourite guest languages among Team PWC members. It is likely next week, we would have a clear winner. All Ruby and Rust contributors keep sharing solutions.


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

  Week      Perl       Raku       Blog   
   279       54       28       16   
   280       54       28       27   
   281       58       25       23   
   282       64       23       18   
   283       62       25       16   

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

  Week      Guests       Contributions       Languages   
   279       16       66       21   
   280       14       63       22   
   281       15       64       23   
   282       14       64       21   
   283       12       61       21   

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     (2730)
 2. Ruby       (721)
 3. Rust       (721)
 4. Haskell    (698)
 5. Lua        (634)
 6. C          (575)
 7. C++        (540)
 8. JavaScript (473)
 9. Go         (398)
10. BQN        (360)

Blogs with Creative Title


1. Numbers and Values by Arne Sommer.

2. Count Unique by Jorg Sommrey.

3. Find the function to find the numbers by Matthias Muth.

4. Bag! Bag! Bag! by Packy Anderson.

5. Occurrences by Peter Campbell Smith.

6. Uniquely Valuable by Roger Bell_West.


GitHub Repository Stats


1. Commits: 39,786 (+151)

2. Pull Requests: 10,684 (+52)

3. Contributors: 250

4. Fork: 316

5. Stars: 175



With start of Week #268, we have a new sponsor Lance Wicks for the entire year 2024. Having said we are looking for more sponsors so that we can go back to weekly 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 - 283 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 #283.

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


Task 1: Lucky Integer

Submitted by: Mohammad Sajid Anwar

You are given an array of integers, @ints.

Write a script to find the lucky integer if found otherwise return -1. If there are more than one then return the largest.

A lucky integer is an integer that has a frequency in the array equal to its value.

Example 1

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

Example 2

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

Example 3

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

Task 2: Relative Sort

Submitted by: Mohammad Sajid Anwar

You are given two list of integers, @list1 and @list2. The elements in the @list2 are distinct and also in the @list1.

Write a script to sort the elements in the @list1 such that the relative order of items in @list1 is same as in the @list2. Elements that is missing in @list2 should be placed at the end of @list1 in ascending order.

Example 1

Input: @list1 = (2, 3, 9, 3, 1, 4, 6, 7, 2, 8, 5)
       @list2 = (2, 1, 4, 3, 5, 6)
Ouput: (2, 2, 1, 4, 3, 3, 5, 6, 7, 8, 9)

Example 2

Input: @list1 = (3, 3, 4, 6, 2, 4, 2, 1, 3)
       @list2 = (1, 3, 2)
Ouput: (1, 3, 3, 3, 2, 2, 4, 4, 6)

Example 3

Input: @list1 = (3, 0, 5, 0, 2, 1, 4, 1, 1)
       @list2 = (1, 0, 3, 2)
Ouput: (1, 1, 1, 0, 0, 3, 2, 4, 5)


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


SO WHAT DO YOU THINK ?

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

Contact with me