The Weekly Challenge - 291

Monday, Oct 14, 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: Middle Index

10. TASK #2: Poker Hand Rankings


HEADLINES


Welcome to the Week #291 of The Weekly Challenge.

Thank you, Ryan Thompson, for back to back contributions in Perl and blog post.

We received 72 guest contributions back to back. Thank you everyone. As of today, we received 2705 contributions in the year 2024 beating last year contributions 2629. The best year for guest contributions was 2022 when we received 2994. I hope we can beat that too.

As for regular contributions, last year 2023 was the best performance year when we received 5702 contributions. As of today, we have received 4501 contributions. There is every possibility we can beat that number this year.

Let’s keep the momentum up and share knowledge every week.


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

  Week      Perl       Raku       Blog   
   286       59       25       20   
   287       52       25       28   
   288       44       18       17   
   289       66       28       31   
   290       60       27       30   

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

  Week      Guests       Contributions       Languages   
   286       14       50       21   
   287       14       63       19   
   288       10       46       16   
   289       18       72       24   
   290       16       74       22   

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     (2984)
 2. Rust       (772)
 3. Ruby       (734)
 4. Haskell    (713)
 5. Lua        (649)
 6. C          (589)
 7. C++        (553)
 8. JavaScript (499)
 9. Go         (422)
10. BQN        (378)

Blogs with Creative Title


1. Finding Double Existence and Applying Luhn’s Algorithm by Andre Ploger.

2. Luhn’s Existence by Arne Sommer.

3. Two Times Zero is Zero by Dave Jacoby.

4. arrays and numbers by Luca Ferrari.

5. Take Me to the Luhn and Back by Matthias Muth.

6. Double Your Pleasure, Double Your Luhn by Packy Anderson.

7. Double existence and checking the payload by Peter Campbell Smith.

8. Double Luhn by Roger Bell_West.

9. Seeing Double, Twice! by Ryan Thompson.

10. Double Luhn by Simon Green.


GitHub Repository Stats


1. Commits: 40,754 (+158)

2. Pull Requests: 11,004 (+43)

3. Contributors: 253

4. Fork: 319

5. Stars: 176 (+1)



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

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


Task 1: Middle Index

Submitted by: Mohammad Sajid Anwar

You are given an array of integers, @ints.

Write a script to find the leftmost middle index (MI) i.e. the smallest amongst all the possible ones.

A middle index is an index where ints[0] + ints[1] + … + ints[MI-1] == ints[MI+1] + ints[MI+2] + … + ints[ints.length-1].

If MI == 0, the left side sum is considered to be 0. Similarly,
if MI == ints.length - 1, the right side sum is considered to be 0.

Return the leftmost MI that satisfies the condition, or -1 if there is no such index.

Example 1

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

The sum of the numbers before index 3 is: 2 + 3 + -1 = 4
The sum of the numbers after index 3 is: 4 = 4

Example 2

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

The sum of the numbers before index 2 is: 1 + -1 = 0
The sum of the numbers after index 2 is: 0

Example 3

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

There is no valid MI.

Task 2: Poker Hand Rankings

Submitted by: Robbie Hatley

A draw poker hand consists of 5 cards, drawn from a pack of 52: no jokers, no wild cards. An ace can rank either high or low.

Write a script to determine the following three things:

1. How many different 5-card hands can be dealt?
2. How many different hands of each of the 10 ranks can be dealt?
   See here for descriptions of the 10 ranks of Poker hands:
   https://en.wikipedia.org/wiki/List_of_poker_hands#Hand-ranking_categories
3. Check the ten numbers you get in step 2 by adding them together
   and showing that they're equal to the number you get in step 1.


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


SO WHAT DO YOU THINK ?

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

Contact with me