The Weekly Challenge - 265

Monday, Apr 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: 33% Appearance

10. TASK #2: Completing Word


HEADLINES


Welcome to the Week #265 of The Weekly Challenge.

Thank you, Andrew Shitov, for reviewing Raku solutions for the Week #263. This was 2 in a row. Thank you, Andrew, for the reviews.

Welcome back, Clifton Wood and thanks for sharing solutions in Raku.



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

  Week      Perl       Raku       Blog   
   260       50       28       27   
   261       55       32       25   
   262       59       32       25   
   263       61       34       28   
   264       50       34       26   

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

  Week      Guests       Contributions       Languages   
   260       14       56       17   
   261       18       79       24   
   262       18       80       24   
   263       19       79       23   
   264       14       66       20   

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     (2423)
 2. Ruby       (672)
 3. Haskell    (654)
 4. Rust       (603)
 5. Lua        (592)
 6. C          (527)
 7. C++        (498)
 8. JavaScript (393)
 9. Go         (351)
10. BQN        (331)

Blogs with Creative Title


1. Greatest Target by Arne Sommer.

2. Everything Under The Sun Is In Tune by Dave Jacoby.

3. The Greatest Target by Jorg Sommrey.

4. array indexes mess by Luca Ferrari.

5. The Greatest, the Greatest by Matthias Muth.

6. I’m The Greatest Target! by Packy Anderson.

7. Greatest letter and mashed arrays by Peter Campbell Smith.

8. Greatest English Array by Roger Bell_West.

9. The greatest array by Simon Green.


GitHub Repository Stats


1. Commits: 37,611 (+107)

2. Pull Requests: 9,924 (+48)

3. Contributors: 243

4. Fork: 306

5. Stars: 171 (+1)



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

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


Task 1: 33% Appearance

Submitted by: Mohammad Sajid Anwar

You are given an array of integers, @ints.

Write a script to find an integer in the given array that appeared 33% or more. If more than one found, return the smallest. If none found then return undef.

Example 1

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

1 appeared 1 times.
2 appeared 2 times.
3 appeared 4 times.

3 appeared 50% (>33%) in the given array.

Example 2

Input: @ints = (1,1)
Output: 1

1 appeared 2 times.

1 appeared 100% (>33%) in the given array.

Example 3

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

1 appeared 1 times.
2 appeared 1 times.
3 appeared 1 times.

Since all three appeared 33.3% (>33%) in the given array.
We pick the smallest of all.

Task 2: Completing Word

Submitted by: Mohammad Sajid Anwar

You are given a string, $str containing alphnumeric characters and array of strings (alphabetic characters only), @str.

Write a script to find the shortest completing word. If none found return empty string.

A completing word is a word that contains all the letters in the given string, ignoring space and number. If a letter appeared more than once in the given string then it must appear the same number or more in the word.

Example 1

Input: $str = 'aBc 11c'
       @str = ('accbbb', 'abc', 'abbc')
Output: 'accbbb'

The given string contains following, ignoring case and number:
a 1 times
b 1 times
c 2 times

The only string in the given array that satisfies the condition is 'accbbb'.

Example 2

Input: $str = 'Da2 abc'
       @str = ('abcm', 'baacd', 'abaadc')
Output: 'baacd'

The given string contains following, ignoring case and number:
a 2 times
b 1 times
c 1 times
d 1 times

The are 2 strings in the given array that satisfies the condition:
'baacd' and 'abaadc'.

Shortest of the two is 'baacd'

Example 3

Input: $str = 'JB 007'
       @str = ('jj', 'bb', 'bjb')
Output: 'bjb'

The given string contains following, ignoring case and number:
j 1 times
b 1 times

The only string in the given array that satisfies the condition is 'bjb'.


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


SO WHAT DO YOU THINK ?

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

Contact with me