The Weekly Challenge - 272

Monday, Jun 3, 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: Defang IP Address

10. TASK #2: String Score


HEADLINES


Welcome to the Week #272 of The Weekly Challenge.

Let us all welcome new member Andrew Schneider, an experienced Perl hacker. Thank you for sharing solutions in Perl and Haskell in the very first week.

I would like to take this opportunity to thank Nelo Tovar for getting back to me with regard to the prize money. Happy to share that the payment gone without any trouble as confirmed by Nelo.

I am still waiting to hear from the remaining two champions, Mustafa Aydin and Asher Harvey-Smith. I would request you to get back to me at perlweeklychallenge@yahoo.com ASAP.

Today is the first Monday and time to declare our next champion. With great pride, I would like to announce Laurent Rosenfeld as the second time champion. Those who are new to Team PWC, he was the first champion declared in the Week #13 (Jun 23, 2019).

Happy to see the pick up in contributions after a little dip in the past two weeks. Please keep the momentum going up.



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

  Week      Perl       Raku       Blog   
   267       50       27       24   
   268       48       31       26   
   269       44       30       24   
   270       39       22       26   
   271       52       28       26   

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

  Week      Guests       Contributions       Languages   
   267       14       58       20   
   268       15       75       26   
   269       13       78       24   
   270       11       50       18   
   271       12       57       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     (2545)
 2. Ruby       (690)
 3. Haskell    (672)
 4. Rust       (643)
 5. Lua        (608)
 6. C          (541)
 7. C++        (510)
 8. JavaScript (421)
 9. Go         (367)
10. BQN        (336)

Blogs with Creative Title


1. Ones by 1 by Arne Sommer.

2. Rows Without A Paddle by Dave Jacoby.

3. Counting Ones by Jorg Sommrey.

4. Riff Raff by Luca Ferrari.

5. You are my only ones… by Matthias Muth.

6. Only Ones by Packy Anderson.

7. All about ones by Peter Campbell Smith.

8. Sort the Maximum One by Roger Bell_West.

9. Maximizing the 1 bits by Simon Green.


GitHub Repository Stats


1. Commits: 38,352 (+110)

2. Pull Requests: 10,181 (+40)

3. Contributors: 244

4. Fork: 310 (+1)

5. Stars: 172



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 - 271 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


Andrew Schneider, an experienced Perl hacker joined the 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 #271.

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


Task 1: Defang IP Address

Submitted by: Mohammad Sajid Anwar

You are given a valid IPv4 address.

Write a script to return the defanged version of the given IP address.

A defanged IP address replaces every period “.” with “[.]".

Example 1

Input: $ip = "1.1.1.1"
Output: "1[.]1[.]1[.]1"

Example 2

Input: $ip = "255.101.1.0"
Output: "255[.]101[.]1[.]0"

Task 2: String Score

Submitted by: Mohammad Sajid Anwar

You are given a string, $str.

Write a script to return the score of the given string.

The score of a string is defined as the sum of the absolute difference between the ASCII values of adjacent characters.

Example 1

Input: $str = "hello"
Output: 13

ASCII values of characters:
h = 104
e = 101
l = 108
l = 108
o = 111

Score => |104 - 101| + |101 - 108| + |108 - 108| + |108 - 111|
      => 3 + 7 + 0 + 3
      => 13

Example 2

Input: "perl"
Output: 30

ASCII values of characters:
p = 112
e = 101
r = 114
l = 108

Score => |112 - 101| + |101 - 114| + |114 - 108|
      => 11 + 13 + 6
      => 30

Example 3

Input: "raku"
Output: 37

ASCII values of characters:
r = 114
a = 97
k = 107
u = 117

Score => |114 - 97| + |97 - 107| + |107 - 117|
      => 17 + 10 + 10
      => 37


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


SO WHAT DO YOU THINK ?

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

Contact with me