The Weekly Challenge - 238

Monday, Oct 9, 2023| 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: Running Sum

10. TASK #2: Persistence Sort


HEADLINES


Welcome to the Week #238 of The Weekly Challenge.

A member of Team PWC raised an issue that I want to share with others with regard to the Task #1 of Week #235.

It turns out most of the linear solutions to that challenge are broken. Many of them do not handle [1,2,3,1,2,3] properly.

What a shame we don’t have resource to review Perl solutions. I must admit, I haven’t looked up the contributions closely to validate the issue raised. It would be great if we get to the bottom of the issue.

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

  Week      Perl       Raku       Blog   
   233       60       35       29   
   234       52       35       24   
   235       61       34       24   
   236       51       34       29   
   237       48       34       26   

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

  Week      Guests       Contributions       Languages   
   233       15       59       16   
   234       12       48       15   
   235       14       78       23   
   236       14       62       20   
   237       14       54       16   

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     (1865)
 2. Ruby       (600
 3. Haskell    (592)
 4. Lua        (524)
 5. C          (441)
 6. Rust       (439)
 7. C++        (411)
 8. BQN        (309)
 9. Go         (280)
10. JavaScript (270)

Blogs with Creative Title


1. Seize the Greatness by Arne Sommer.

2. Carpe Diem by Avery Adams.

3. Maximise Greatness by Bob Lied.

4. Greatness Thrust Upon Them by Dave Jacoby.

5. in the need for caffeine! by Luca Ferrari.

6. Maximal Great Day! by Matthias Muth.

7. Minute by minute, that’s how you win it! by Packy Anderson.

8. Seize the greatness by Peter Campbell Smith.

9. Seize Greatness by Roger Bell_West.

10. Seize the greatness by Simon Green.


GitHub Repository Stats


1. Commits: 34,539 (+97)

2. Pull Requests: 8,820 (+38)

3. Contributors: 233 (+1)

4. Fork: 293 (+2)

5. Stars: 164 (+1)



Our solo sponsor Pete Sergeant has been a great support to keep us motivated. We are lucky that he agreed to continue the journey with us in the year 2023. I would like to personally thank Pete and his entire team for their generosity. It would be great if we could add few more to sponsor the prize money so that we could go back and declare weekly champions as we have done in the past. I hope and wish this will become possible in 2023. The amount doesn’t have to be huge. However, it would be nice to show off bunch of supporters. If an organisation comes forward and supports us then that would be the ultimate achievement.


RECAP


Quick recap of The Weekly Challenge - 237 by Mohammad S 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 #237.

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


Task 1: Running Sum

Submitted by: Mohammad S Anwar

You are given an array of integers.

Write a script to return the running sum of the given array. The running sum can be calculated as sum[i] = num[0] + num[1] + …. + num[i].

Example 1

Input: @int = (1, 2, 3, 4, 5)
Output: (1, 3, 6, 10, 15)

Example 2

Input: @int = (1, 1, 1, 1, 1)
Output: (1, 2, 3, 4, 5)

Example 3

Input: @int = (0, -1, 1, 2)
Output: (0, -1, 0, 2)

Task 2: Persistence Sort

Submitted by: Mohammad S Anwar

You are given an array of positive integers.

Write a script to sort the given array in increasing order with respect to the count of steps required to obtain a single-digit number by multiplying its digits recursively for each array element. If any two numbers have the same count of steps, then print the smaller number first.

Example 1

Input: @int = (15, 99, 1, 34)
Output: (1, 15, 34, 99)

15 => 1 x 5 => 5 (1 step)
99 => 9 x 9 => 81 => 8 x 1 => 8 (2 steps)
1  => 0 step
34 => 3 x 4 => 12 => 1 x 2 => 2 (2 steps)

Example 2

Input: @int = (50, 25, 33, 22)
Output: (22, 33, 50, 25)

50 => 5 x 0 => 0 (1 step)
25 => 2 x 5 => 10 => 1 x 0 => 0 (2 steps)
33 => 3 x 3 => 9 (1 step)
22 => 2 x 2 => 4 (1 step)


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


SO WHAT DO YOU THINK ?

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

Contact with me