The Weekly Challenge - 099

Monday, Feb 8, 2021| 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: Pattern Match

10. TASK #2: Unique Subsequence


HEADLINES



Welcome to Week #99 of the weekly challenge. We are almost there, so please keep your seat belt fastened.

As you all know last week we declared Stuart Little, first Champion of 2021. To my surprise he donated the prize money towards the fund for the website. Technical speaking, it never existed before as we never received any donations in the past. I would like to thank Stuart for the donation. As of today, the total fund is £40. I will keep record of all transactions and share with the team at the end of financial year. I am going to use the fund to renew the domain when it expires.

I appeal to all Team PWC members to make the Week #100 special by breaking the record contributions. The current record is held by Week #001 with 155 contributions of Perl and Raku solutions as well as blogs. I think it is very much possible with 200+ members. Even if 100 members share just either Perl or Raku only, we can easily go past 200 mark. Let us create history and be part of it.

In the Week #97, I shared my idea of celebration. I have had few suggestions so far. I am looking for more, so please keep sharing your views on the same.

In the recent few weeks, I noticed a big jump in the contributions as far as guest languages are concerned. In the early days, we used to receive just 2-4 solutions. But now a days, we get 40+ contributions regularly. I also noticed some members showing love for opposite camp. I mean, Raku fan sharing Perl solutions and Perl fan sharing Raku. To me, it is the biggest take away of the initiative started nearly 2 years ago.

I have seen the popularity of weekly challenge growing every week. Some of the recently joined member surprised me with their commitment and energy. I know from my own experience it is certainly not easy to carry on week after week. I am aware that you have been missing Raku reviews for sometimes. I am looking for volunteer to take the responsibilty and show us the power of Raku. As far as Perl reviews are concerned, Colin Crain is doing great. I have seen nice positive comments every time I share the same on Twitter, Facebook and Reddit.


Contributions Summary

This week, we received 45 contributions from guests in 17 languages.

I would like to THANK each and every guest contributors.


Languages Summary


While we are talking about contributions, let’s share some interesting stats from the GitHub repository.

1. Commits: 14,067 (+164)

2. Pull Requests: 3,473 (+42)

3. Contributors: 158

4. Fork: 199

5. Stars: 90 (+1)


Last but not least, I would like to thank each and every member for their support and encouragement.



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 2021. 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 2021. 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 “The Weekly Challenge - 098” by Mohammad S Anwar.


PERL REVIEW


Please check out Perl solutions review of the “Perl Weekly Challenge - 096” by Colin Crain.

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


01. Abigail shared solution to Task #1 in Awk.

02. Abigail shared solutions to Task #1 and Task #2 in Bash.

03. Abigail shared solution to Task #1 in C.

04. Abigail shared solution to Task #1 in Lua.

05. Adam Russell shared solutions to Task #1 and Task #2 in Prolog.

06. Cristina Heredia shared solutions to Task #1 and Task #2 in Python.

07. Frank Oosterhuis shared solution to Task #2 in Scala.

08. Mohammad Meraj Zia shared solution to Task #2 in Java.

09. Nuno Vieira shared solutions to Task #1 and Task #2 in JavaScript.

10. Paulo Custodio shared solutions to Task #1 and Task #2 in Ada.

11. Paulo Custodio shared solutions to Task #1 and Task #2 in Awk.

12. Paulo Custodio shared solutions to Task #1 and Task #2 in Basic.

13. Paulo Custodio shared solutions to Task #1 and Task #2 in C.

14. Paulo Custodio shared solutions to Task #1 and Task #2 in C++.

15. Paulo Custodio shared solutions to Task #1 and Task #2 in Forth.

16. Paulo Custodio shared solutions to Task #1 and Task #2 in Lua.

17. Paulo Custodio shared solutions to Task #1 and Task #2 in Python.

18. Roger Bell_West shared solutions to Task #1 and Task #2 in Python.

19. Roger Bell_West shared solutions to Task #1 and Task #2 in Ruby.

20. Roger Bell_West shared solutions to Task #1 and Task #2 in Rust.

21. Stuart Little shared solutions to Task #1 and Task #2 in Haskell.

22. Tyler Wardhaugh shared solutions to Task #1 and Task #2 in Clojure.

23. Tyler Wardhaugh shared solutions to Task #1 and Task #2 in Lua.

24. Tyler Wardhaugh shared solutions to Task #1 and Task #2 in Python.

25. Ulrich Rieke shared solution to Task #2 in C++.

26. Ulrich Rieke shared solution to Task #2 in Haskell.


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


TASK #1 › Pattern Match

Submitted by: Mohammad S Anwar

You are given a string $S and a pattern $P.

Write a script to check if given pattern validate the entire string. Print 1 if pass otherwise 0.

The patterns can also have the following characters:

? - Match any single character.
* - Match any sequence of characters.

Example 1:

Input: $S = "abcde" $P = "a*e"
Output: 1

Example 2:

Input: $S = "abcde" $P = "a*d"
Output: 0

Example 3:

Input: $S = "abcde" $P = "?b*d"
Output: 0

Example 4:

Input: $S = "abcde" $P = "a*c?e"
Output: 1


TASK #2 › Unique Subsequence

Submitted by: Mohammad S Anwar

You are given two strings $S and $T.

Write a script to find out count of different unique subsequences matching $T without changing the position of characters.

UPDATE: 2021-02-08 09:00AM (UK TIME) suggested by Jonas Berlin, missing entry [5].

Example 1:

Input: $S = "littleit', $T = 'lit'
Output: 5

    1: [lit] tleit
    2: [li] t [t] leit
    3: [li] ttlei [t]
    4: litt [l] e [it]
    5: [l] ittle [it]

Example 2:

Input: $S = "london', $T = 'lon'
Output: 3

    1: [lon] don
    2: [lo] ndo [n]
    3: [l] ond [on]


Last date to submit the solution 23:59 (UK Time) Sunday 14th February 2021.


SO WHAT DO YOU THINK ?

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

Contact with me