The Weekly Challenge - 223

Monday, Jun 26, 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: Count Primes

10. TASK #2: Box Coins


HEADLINES


Welcome to the Week #223 of The Weekly Challenge.

Last week we had two comebacks, Colin Crain and Dave Jacoby. You really don’t want to miss out the blog posts by them i.e. Last Number Standing and Member-ship has its Privileges.

Recently, a very good friend of mine, Lance Wicks, also made a comeback recently shared this blog post.

Talking about comebacks, Simon Proctor also returned back and shared solutions for Week 220, Week 221 and Week 222.

Today, we are giving away Coupon #46 to Steven Wilson for the book, Learning Perl Exercises by brian d foy. I will share the details with you in a separate email.

I would like to request BarrOff to share email address with us, so that ebook can be shared with him.

PAST WINNERS

  S. No.    Name S. No.  Name
1.  Cheok-Yin Fung 2.  W. Luis Mochan
3.  Robert DiCicco 4.  Kueppo Wesley
5.  Solathian 6.  Dario Mazzeo
7.  Peter Campbell Smith   8.  Kjetil Skotheim
9.  Neils van Dijke 10.  Laurent Rosenfeld  
11.  Duncan C. White 12.  Ali Moradi
13.  Jorg Sommrey 14.  James Smith
15.  Alexander Pankoff 16.  Simon Green
17.  Robbie Hatley 18.  Bob Lied
19.  Athanasius 20.  David Ferrone
21.  Thomas Kohler 22.  Adam Russell
23.  E. Choroba 24.  Pip Stuart
25.  Roger Bell_West 26.  Flavio Poletti
27.  Dave Jacoby 28.  Mariano Spadaccini
29.  Lubos Kolouch 30.  Matthew Neleigh
31.  Paulo Custodio 32.  Tyler Bird
33.  Carlos Oliveira 34.  Avery Adams
35.  Matthias Muth 36.  Leo Manfredi
37.  Peter Meszaros 38.  Arne Sommer
39.  Jaldhar H. Vyas 40.  Mark Anderson
41.  Rob Turner 42.  BarrOff
43.  Robert Ransbottom 44.  Peter Meszaros
45.  Jan Krnavek 46.
47. 48.
49. 50.

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

  Week      Perl       Raku       Blog   
   218       43       22       16   
   219       35       22       22   
   220       49       29       18   
   221       39       27       16   
   222       56       30       19   

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

  Week      Guests       Contributions       Languages   
   218       10       36       15   
   219       12       37       15   
   220       06       32       10   
   221       07       23       09   
   222       10       41       14   

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  (1613)
 2. Haskell (559)
 3. Ruby    (532)
 4. Lua     (479)
 5. C       (428)
 6. C++     (382)
 7. Rust    (382)
 8. BQN     (299)
 9. Go      (258)
10. Java    (235)

Blogs with Creative Title


1. Raku Members by Arne Sommer.

2. Checking Against My List of Members by Avery Adams.

3. Last Number Standing by Colin Ceain.

4. Member-ship has its Privileges by Dave Jacoby.

5. Lazy, Lazy, Lazy Again … by Matthias Muth.

6. Members’ week by Peter Campbell Smith.

7. Members Everywhere by Roger Bell_West.

8. All the ducks. Two twenty two by Simon Green.


GitHub Repository Stats


1. Commits: 33,008 (+105)

2. Pull Requests: 8,274 (+35)

3. Contributors: 225

4. Fork: 285 (+2)

5. Stars: 159 (+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 - 222 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 #222.

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


Task 1: Count Primes

Submitted by: Mohammad S Anwar

You are given a positive integer, $n.

Write a script to find the total count of primes less than or equal to the given integer.


Example 1

Input: $n = 10
Output: 4

Since there are 4 primes (2,3,5,7) less than or equal to 10.

Example 2

Input: $n = 1
Output: 0

Example 3

Input: $n = 20
Output: 8

Since there are 4 primes (2,3,5,7,11,13,17,19) less than or equal to 20.

Task 2: Box Coins

Submitted by: Mohammad S Anwar

You are given an array representing box coins, @box.

Write a script to collect the maximum coins until you took out all boxes. If we pick box[i] then we collect the coins $box[i-1] * $box[i] * $box[i+1]. If $box[i+1] or $box[i-1] is out of bound then treat it as 1 coin.


Example 1:

Input: @box = (3, 1, 5, 8)
Output: 167

Step 1: pick box [i=1] and collected coins 3 * 1 * 5 => 15.  Boxes available (3, 5, 8).
Step 2: pick box [i=1] and collected coins 3 * 5 * 8 => 120. Boxes available (3, 8).
Step 3: pick box [i=0] and collected coins 1 * 3 * 8 => 24.  Boxes available (8).
Step 4: pick box [i=0] and collected coins 1 * 8 * 1 => 8.   No more box available.

Example 2:

Input: @box = (1, 5)
Output: 10

Step 1: pick box [i=0] and collected coins 1 * 1 * 5 => 5. Boxes available (5).
Step 2: pick box [i=0] and collected coins 1 * 5 * 1 => 5. No more box available.


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


SO WHAT DO YOU THINK ?

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

Contact with me