The Weekly Challenge - 287

Monday, Sep 16, 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: Strong Password

10. TASK #2: Valid Number


HEADLINES


Welcome to the Week #287 of The Weekly Challenge.

Thanks Torgny Lyon for sharing profile photo.

Thanks Peter Penchtev for sharing solutions in Perl for the first time.

Thank you, Conor Hoekstra, for catching up with solutions in BQN.

Thank you, Paulo Custodio, for sharing solution to past challenges in Python.

I would also like to thank Peter Meszaros for getting past challenges done in Perl.


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

  Week      Perl       Raku       Blog   
   282       64       23       18   
   283       62       25       16   
   284       68       23       16   
   285       61       23       18   
   286       59       25       20   

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

  Week      Guests       Contributions       Languages   
   282       14       64       21   
   283       12       61       21   
   284       20       74       24   
   285       16       71       25   
   286       13       48       21   

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     (2818)
 2. Rust       (742)
 3. Ruby       (726)
 4. Haskell    (706)
 5. Lua        (639)
 6. C          (581)
 7. C++        (546)
 8. JavaScript (484)
 9. Go         (406)
10. BQN        (366)

Blogs with Creative Title


1. Self Order by Arne Sommer.

2. Not Quite a Quine by David Ferrone.

3. Randomly Extremal by Jorg Sommrey.

4. The Random Spammer Testing Game by Matthias Muth.

5. Spammer Game by Packy Anderson.

6. My word - and min max by Peter Campbell Smith.

7. The Game of Order by Roger Bell_West.

8. Quines are boring, but generative AI still can’t do my job by Tim King.


GitHub Repository Stats


1. Commits: 40,218 (+138)

2. Pull Requests: 10,834 (+51)

3. Contributors: 253

4. Fork: 319

5. Stars: 175



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 - 286 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 #286.

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


Task 1: Strong Password

Submitted by: Mohammad Sajid Anwar

You are given a string, $str.

Write a program to return the minimum number of steps required to make the given string very strong password. If it is already strong then return 0.

Criteria:

- It must have at least 6 characters.
- It must contains at least one lowercase letter, at least one upper case letter and at least one digit.
- It shouldn't contain 3 repeating characters in a row.

Following can be considered as one step:

- Insert one character
- Delete one character
- Replace one character with another

Example 1

Input: $str = "a"
Output: 5

Example 2

Input: $str = "aB2"
Output: 3

Example 3

Input: $str = "PaaSW0rd"
Output: 0

Example 4

Input: $str = "Paaasw0rd"
Output: 1

Example 5

Input: $str = "aaaaa"
Output: 2

Task 2: Valid Number

Submitted by: Mohammad Sajid Anwar

You are given a string, $str.

Write a script to find if it is a valid number.

Conditions for a valid number:

- An integer number followed by an optional exponent.
- A decimal number followed by an optional exponent.
- An integer number is defined with an optional sign '-' or '+' followed by digits.

Decimal Number:

A decimal number is defined with an optional sign '-' or '+' followed by one of the following definitions:
- Digits followed by a dot '.'.
- Digits followed by a dot '.' followed by digits.
- A dot '.' followed by digits.

Exponent:

An exponent is defined with an exponent notation 'e' or 'E' followed by an integer number.

Example 1

Input: $str = "1"
Output: true

Example 2

Input: $str = "a"
Output: false

Example 3

Input: $str = "."
Output: false

Example 4

Input: $str = "1.2e4.2"
Output: false

Example 5

Input: $str = "-1."
Output: true

Example 6

Input: $str = "+1E-8"
Output: true

Example 7

Input: $str = ".44"
Output: true


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


SO WHAT DO YOU THINK ?

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

Contact with me