The Weekly Challenge - 271

Monday, May 27, 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: Maximum Ones

10. TASK #2: Sort by 1 bits


HEADLINES


Welcome to the Week #271 of The Weekly Challenge.

Thank you. Lance Wicks, for yet another contribution in Perl.

I would also like to thank, Nelo Tovar, for getting back to me with regard to the prize money. I replied to your email with a quick question. Please respond as soon as you find time and I will transfer the cash prize money to you.

Last week was a bit slow comparatively. Is it because of summer holiday period? Anyway, keep contributing and sharing the knowledge with your fellow team members.



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

  Week      Perl       Raku       Blog   
   266       55       29       24   
   267       50       27       24   
   268       48       31       26   
   269       44       30       24   
   270       41       24       27   

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

  Week      Guests       Contributions       Languages   
   266       12       53       16   
   267       14       58       20   
   268       15       75       26   
   269       13       78       24   
   270       11       50       18   

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     (2529)
 2. Ruby       (686)
 3. Haskell    (670)
 4. Rust       (639)
 5. Lua        (604)
 6. C          (539)
 7. C++        (510)
 8. JavaScript (417)
 9. Go         (365)
10. BQN        (336)

Blogs with Creative Title


1. Distribute Positions by Arne Sommer.

2. When A Decision Must Be Made by Dave Jacoby.

3. Special Levels by Jorg Sommrey.

4. Even More Special Levels by Jorg Sommrey.

5. no passion this week! by Luca Ferrari.

6. Hidden loops. Or no loops at all. by Matthias Muth.

7. Lonely ones and equalities by Peter Campbell Smith.

8. Special Distribtions Position the Elements by Roger Bell_West.

9. Equalizing positions by Simon Green.


GitHub Repository Stats


1. Commits: 38,242 (+109)

2. Pull Requests: 10,141 (+39)

3. Contributors: 244

4. Fork: 309

5. Stars: 173 (+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 - 270 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 #270.

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


Task 1: Maximum Ones

Submitted by: Mohammad Sajid Anwar

You are given a m x n binary matrix.

Write a script to return the row number containing maximum ones, in case of more than one rows then return smallest row number.

Example 1

Input: $matrix = [ [0, 1],
                   [1, 0],
                 ]
Output: 1

Row 1 and Row 2 have the same number of ones, so return row 1.

Example 2

Input: $matrix = [ [0, 0, 0],
                   [1, 0, 1],
                 ]
Output: 2

Row 2 has the maximum ones, so return row 2.

Example 3

Input: $matrix = [ [0, 0],
                   [1, 1],
                   [0, 0],
                 ]
Output: 2

Row 2 have the maximum ones, so return row 2.

Task 2: Sort by 1 bits

Submitted by: Mohammad Sajid Anwar

You are give an array of integers, @ints.

Write a script to sort the integers in ascending order by the number of 1 bits in their binary representation. In case more than one integers have the same number of 1 bits then sort them in ascending order.

Example 1

Input: @ints = (0, 1, 2, 3, 4, 5, 6, 7, 8)
Output: (0, 1, 2, 4, 8, 3, 5, 6, 7)

0 = 0 one bits
1 = 1 one bits
2 = 1 one bits
4 = 1 one bits
8 = 1 one bits
3 = 2 one bits
5 = 2 one bits
6 = 2 one bits
7 = 3 one bits

Example 2

Input: @ints = (1024, 512, 256, 128, 64)
Output: (64, 128, 256, 512, 1024)

All integers in the given array have one 1-bits, so just sort them in ascending order.


Last date to submit the solution 23:59 (UK Time) Sunday 2nd June 2024.


SO WHAT DO YOU THINK ?

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

Contact with me