The Weekly Challenge - 252

Monday, Jan 15, 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: Special Numbers

10. TASK #2: Unique Sum Zero


HEADLINES


Welcome to the Week #252 of The Weekly Challenge.

New year keep bringing new member to the team. Last week, we had new member, Scott Sotka, joining Team PWC. He has contributed solutions to Task #1 and Task #2 in Raku.

We all know, Python is one of the most favourite language among team members. It has been on top rank #1 for the longest. Looking at the numbers, I doubt if any other language is a threat.

Talking about contributions, how can we not talk about the twins, Perl and Raku. As of today, we are reaching 13K solutions in Perl approximately and 7.5K solutions in Raku approx.

Let’s hope we continue this journey together with even more power in the year 2024.


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

  Week      Perl       Raku       Blog   
   247       42       21       22   
   248       50       29       24   
   249       51       24       23   
   250       56       34       27   
   251       51       33       23   

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

  Week      Guests       Contributions       Languages   
   247       10       37       14   
   248       10       41       13   
   249       12       46       14   
   250       16       82       23   
   251       16       53       16   

TOP 10 Guest Languages


Go lang moved up one rank to #8. Congratulation to all Go contributors.

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     (2119)
 2. Ruby       (642)
 3. Haskell    (623)
 4. Lua        (566)
 5. Rust       (498)
 6. C          (471)
 7. C++        (462)
 8. Go         (317)
 9. BQN        (315)
10. JavaScript (309)

Blogs with Creative Title


1. Lucky Concatenation by Arne Sommer.

2. Do You Feel Lucky? by Dave Jacoby.

3. Lucky Cats by Jorg Sommrey.

4. rows and cols, what a mess! by Luca Ferrari.

5. Luck Concatenate Numbers Tonight! by Packy Anderson.

6. Lucky concatenations by Peter Campbell Smith.

7. Concatenating Luck by Roger Bell_West.

8. Lucky values by Simon Green.


GitHub Repository Stats


1. Commits: 36,095 (+97)

2. Pull Requests: 9,387 (+36)

3. Contributors: 241 (+1)

4. Fork: 304 (+1)

5. Stars: 166



In the year 2024, we are looking for new sponsor for monthly 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 - 251 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


Scott Sotka, an experienced Raku hacker 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 #251.

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


Task 1: Special Numbers

Submitted by: Mohammad S Anwar

You are given an array of integers, @ints.

Write a script to find the sum of the squares of all special elements of the given array.


An element $int[i] of @ints is called special if i divides n, i.e. n % i == 0.
Where n is the length of the given array. Also the array is 1-indexed for the task.

Example 1

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

There are exactly 3 special elements in the given array:
$ints[1] since 1 divides 4,
$ints[2] since 2 divides 4, and
$ints[4] since 4 divides 4.

Hence, the sum of the squares of all special elements of given array:
1 * 1 + 2 * 2 + 4 * 4 = 21.

Example 2

Input: @ints = (2, 7, 1, 19, 18, 3)
Output: 63

There are exactly 4 special elements in the given array:
$ints[1] since 1 divides 6,
$ints[2] since 2 divides 6,
$ints[3] since 3 divides 6, and
$ints[6] since 6 divides 6.

Hence, the sum of the squares of all special elements of given array:
2 * 2 + 7 * 7 + 1 * 1 + 3 * 3 = 63

Task 2: Unique Sum Zero

Submitted by: Mohammad S Anwar

You are given an integer, $n.

Write a script to find an array containing $n unique integers such that they add up to zero.

Example 1

Input: $n = 5
Output: (-7, -1, 1, 3, 4)

Two other possible solutions could be as below:
(-5, -1, 1, 2, 3) and (-3, -1, 2, -2, 4).

Example 2

Input: $n = 3
Output: (-1, 0, 1)

Example 3

Input: $n = 1
Output: (0)


Last date to submit the solution 23:59 (UK Time) Sunday 21st January 2024.


SO WHAT DO YOU THINK ?

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

Contact with me