The Weekly Challenge - 302

Monday, Dec 30, 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: Ones and Zeroes

10. TASK #2: Step by Step


HEADLINES


Welcome to the Week #302 of The Weekly Challenge.

Let us all welcome a new member, Andreas Mahnke, from Germany. Thanks for sharing your first contributions in Perl.

Two in a row, we received contributions in Perl and C from Ryan Thompson. There is bonus blog post too.

I would also like to thank, Bruno Ramos, a long time Team PWC member for the first contributions in Perl. I hope to see more in coming weeks.

We’ve now completed successfully another Advent Calendar, the 6th in a row. A big thanks to each and every contributors. It wouldn’t have possible without your consistent support and encouragement.

I am hoping your new year celebration is already started. I wish you all a very healthy and prosperous new year.


Advent Calendar 2024


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

Day 2: Special Zeroes by Jorg Sommrey.

Day 3: Split the weakest by Peter Campbell Smith.

Day 4: Reverse Power by Arne Sommer.

Day 5: Odd Character / Most Frequent Word by Laurent Rosenfeld.

Day 6: Easy Pairs - Easy Merge by Matthias Muth.

Day 7: Smaller than Echelon by Roger Bell_West.

Day 8: Count Sumofvaluacula by Adam Russell.

Day 9: Target Index / Merge Items by James Smith.

Day 10: Unique Occurrences / Dictionary Rank by Robbie Hatley.

Day 11: Element Digit Sum / Dictionary Rank by Simon Green.

Day 12: Max Positive Negative / Count Equal Divisible by Ali Moradi.

Day 13: Don’t Sort It, Be Happy by Bob Lied.

Day 14: Greatest English Letter / Target Array by W. Luis Mochan.

Day 15: TDD for Good… strings by Lance Wicks.

Day 16: Complete Day / Maximum Frequency by Ryan Thompson.

Day 17: Strong Password by E. Choroba.

Day 18: Where is the chess piece going to? by Cheok-Yin Fung.

Day 19: Lost Connections and Making Changes by David Ferrone.

Day 20: Occurrences with BQN by BarrOff.

Day 21: Strength Uncombined by Bruce Gray.

Day 22: Spammer Game by Packy Anderson.

Day 23: Maximal Square / Right Interval by Luca Ferrari.

Day 24: Ones and Zeroes / Step by Step by Jaldhar H. Vyas.

Day 25: REVIEW 2024 by Mohammad Sajid Anwar.



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

  Week      Perl       Raku       Blog   
   297       44       20       23   
   298       35       18       21   
   299       37       13       10   
   300       41       19       16   
   301       43       18       12   

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

  Week      Guests       Contributions       Languages   
   297       13       53       18   
   298       9       45       19   
   299       10       45       19   
   300       10       42       16   
   301       9       39       15   

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     (3123)
 2. Rust       (820)
 3. Ruby       (757)
 4. Haskell    (733)
 5. Lua        (674)
 6. C          (590)
 7. C++        (575)
 8. JavaScript (520)
 9. Go         (444)
10. BQN        (402)

Blogs with Creative Title


1. Hamming Largest by Arne Sommer.

2. Auld Lang Comparison by Dave Jacoby.

3. Hamming it Large by Roger Bell_West.

4. Hammering lists by Simon Green.


GitHub Repository Stats


1. Commits: 41,736 (+85)

2. Pull Requests: 11,357 (+31)

3. Contributors: 256 (+2)

4. Fork: 323 (+2)

5. Stars: 180 (+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 - 301 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


Andreas Mahnke, an expert Perl hacker from Germany, joined Team PWC.

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

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


Task 1: Ones and Zeroes

Submitted by: Mohammad Sajid Anwar

You are given an array of binary strings, @str, and two integers, $x and $y.

Write a script to return the size of the largest subset of @str such that there are at most $x 0’s and $y 1’s in the subset.

A set m is a subset of n if all elements of m are also elements of n.

Example 1

Input: @str = ("10", "0001", "111001", "1", "0")
       $x = 5
       $y = 3
Output: 4

The largest subset with at most five 0's and three 1's:
("10", "0001", "1", "0")

Example 2

Input: @str = ("10", "1", "0")
       $x = 1
       $y = 1
Output: 2

The largest subset with at most one 0's and one 1's:
("1", "0")

Task 2: Step by Step

Submitted by: Mohammad Sajid Anwar

You are given an array of integers, @ints.

Write a script to find the minimum positive start value such that step by step sum is never less than one.

Example 1

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

For start value 5.
5 + (-3) = 2
2 + (+2) = 4
4 + (-3) = 1
1 + (+4) = 5
5 + (+2) = 7

Example 2

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

Example 3

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


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


SO WHAT DO YOU THINK ?

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

Contact with me