The Weekly Challenge - 191

Monday, Nov 14, 2022| 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: Twice Largest

10. TASK #2: Cute List


HEADLINES


Welcome to the Week #191 of The Weekly Challenge.

Last week, I forgot to announce the champion as it was the first Monday of the month. Apology.

Today, we announce our next champion, Feng Chang, from Beijing, China. He joined the Team PWC long time ago, in the Week 12, to be precise. It took so long to nominate him as champion, sorry. He is currently ranked #30 in the leader board with total score 392. As of today, he has contributed 23 Perl and 173 Raku solutions.

Another busy week with 100+ contributions. This is the record in the history of The Weekly Challenge, we achieved the target for the 7 consecutive weeks. Thank you Team PWC for the support and encouragement.

  Week      184       185       186       187       188       189       190   
Perl 57 61 58 51 63 62 55
Raku 31 35 33 34 36 35 32
Blog 17 19 20 20 16 18 23

Last week, we had 38 regular contributors and 12 guest contributors. Thank you everyone for the support and encouragement.

Today, we are giving away Token #14 to James Smith for the book, Learning Perl Exercises by brian d foy. I will share the details with you in a separate email.

Past Winners

  S. No.   Name S. No. Name
1. Cheok-Yin Fung 2. W. Luis Mochan
3. Robert DiCicco 4. Kueppo Wesley
5. Solathian 6. Dario Mazzeo
7.   Peter Campbell Smith   8. Kjetil Skotheim
9. Neils van Dijke 10.   Laurent Rosenfeld  
11. Duncan C. White 12. Ali Moradi
13. Jorg Sommrey 14.
15. 16.
17. 18.
19. 20.
21. 22.
23. 24.
25. 26.
27. 28.
29. 30.
31. 32.
33. 34.
35. 36.
37. 38.
39. 40.
41. 42.
43. 44.
45. 46.
47. 48.
49. 50.

I would like to thank every guest contributors for making it special every week. Last week we received 39 guest contributions in 15 languages`.

Last week, I could only find time to do just one task.


Task #1: Capital Detection     [Perl] [Raku] [Python] [Java] [Swift]

Capital Detection


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  (1187)
 2. Haskell (508)
 3. Ruby    (417)
 4. Lua     (403)
 5. C       (286)
 6. C++     (286)
 7. BQN     (265)
 8. Rust    (255)
 9. Go      (228)
10. Java    (205)

Blogs with Creative Title


1. Regex Weekly Challenge and Chunkify and decode by Alexander Pankoff.

2. Decoded Capital by Arne Sommer.

3. Where Do We Put the Walls? by Colin Crain.

4. decoding strings by Luca Ferrari.

5. Capital test and ambiuous encoding by Peter Campbell Smith.

6. Decoding Capital by Roger Bell_West.

7. Capital letters decoded! by Simon Green.


GitHub Repository Stats


1. Commits: 29,062 (+130)

2. Pull Requests: 7,073 (+36)

3. Contributors: 211

4. Fork: 267

5. Stars: 147 (+2)



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 2022. 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 2022. 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 Weekly Challenge - 190 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


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

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


Task 1: Twice Largest

Submitted by: Mohammad S Anwar

You are given list of integers, @list.

Write a script to find out whether the largest item in the list is at least twice as large as each of the other items.

Example 1

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

The largest in the given list is 4. However 4 is not greater than twice of every remaining elements.
1 x 2 <= 4
2 x 2 <= 4
2 x 3 >  4

Example 2

Input: @list = (1,2,0,5)
Output: 1

The largest in the given list is 5. Also 5 is greater than twice of every remaining elements.
1 x 2 <= 5
2 x 2 <= 5
0 x 2 <= 5

Example 3

Input: @list = (2,6,3,1)
Output: 1

The largest in the given list is 6. Also 6 is greater than twice of every remaining elements.
2 x 2 <= 6
3 x 2 <= 6
1 x 2 <= 6

Example 4

Input: @list = (4,5,2,3)
Output: -1

The largest in the given list is 5. Also 5 is not greater than twice of every remaining elements.
4 x 2 >  5
2 x 2 <= 5
3 x 2 >  5

Task 2: Cute List

Submitted by: Mohammad S Anwar

You are given an integer, 0 < $n <= 15.

Write a script to find the number of orderings of numbers that form a cute list.

With an input @list = (1, 2, 3, .. $n) for positive integer $n, an ordering of @list is cute if for every entry, indexed with a base of 1, either

1) $list[$i] is evenly divisible by $i
or
2) $i is evenly divisible by $list[$i]

Example

Input: $n = 2
Ouput: 2

Since $n = 2, the list can be made up of two integers only i.e. 1 and 2.
Therefore we can have two list i.e. (1,2) and (2,1).

@list = (1,2) is cute since $list[1] = 1 is divisible by 1 and $list[2] = 2 is divisible by 2.


Last date to submit the solution 23:59 (UK Time) Sunday 20th November 2022.


SO WHAT DO YOU THINK ?

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

Contact with me