TABLE OF CONTENTS
1. HEADLINES
2. SPONSOR
3. RECAP
4. PERL REVIEW
5. RAKU REVIEW
6. CHART
7. NEW MEMBERS
8. GUESTS
9. TASK #1: Consecutive One
10. TASK #2: Final Price
HEADLINES
Welcome to the Week #325
of The Weekly Challenge
.
Thank you, Yitzchak Scott-Thoennes
, for sharing the blog post for the first time.
Thank you, HVukman
, for sharing solution in J.
I noticed a big dip in guest contributions as compared to a week before i.e. from Week 323: 60
to Week 324: 38
.
I hope it would take a jump this week, fingers crossed.
Happy Hacking!!
Last 5 weeks
mainstream contribution stats. Thank you Team PWC
for your support and encouragements.
Week |
Perl |
Raku |
Blog |
320 |
46 | 26 | 18 |
321 |
46 | 26 | 27 |
322 |
44 | 24 | 25 |
323 |
46 | 22 | 26 |
324 |
44 | 24 | 16 |
Last 5 weeks
guest contribution stats. Thank you each and every guest contributors for your time and efforts.
Week |
Guests |
Contributions |
Languages |
320 |
14 | 62 | 23 |
321 |
13 | 61 | 23 |
322 |
13 | 56 | 19 |
323 |
12 | 60 | 21 |
324 |
12 | 38 | 15 |
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 (3410)
2. Rust (918)
3. Ruby (801)
4. Haskell (781)
5. Lua (726)
6. C++ (621)
7. C (590)
8. JavaScript (564)
9. Go (493)
10. BQN (442)
Blogs with Creative Title
1. Two Dimensional XOR Not? by Adam Russell.
2. Exclusive or 2D by Arne Sommer.
3. Or Is It Reshaped? by Jorg Sommrey.
4. Reduce and Reduce, and Reduce! by Matthias Muth.
5. Total 2bular! by Packy Anderson.
6. Fun with arrays by Peter Campbell Smith.
7. The Total Array of Xor in 2-D by Roger Bell_West.
8. The total array by Simon Green.
GitHub Repository Stats
1. Commits: 43,833 (+98
)
2. Pull Requests: 12,132 (+36
)
3. Contributors: 260
4. Fork: 327
5. Stars: 191
SPONSOR
With start of Week #268
, we have a new sponsor Lance Wicks
until the end of year 2025
. 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 - 324 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 #324.
Please find past solutions by respected guests. Please share your creative solutions in other languages.
Task 1: Consecutive One
Submitted by: Mohammad Sajid Anwar
You are given a binary array containing only 0
or/and 1
.
Write a script to find out the maximum consecutive 1
in the given array.
Example 1
Input: @binary = (0, 1, 1, 0, 1, 1, 1)
Output: 3
Example 2
Input: @binary = (0, 0, 0, 0)
Output: 0
Example 3
Input: @binary = (1, 0, 1, 0, 1, 1)
Output: 2
Task 2: Final Price
Submitted by: Mohammad Sajid Anwar
You are given an array of item prices.
Write a script to find out the final price of each items in the given array.
There is a special discount scheme going on. If there’s an item with a lower or equal price later in the list, you get a discount equal to that later price (the first one you find in order).
Example 1
Input: @prices = (8, 4, 6, 2, 3)
Output: (4, 2, 4, 2, 3)
Item 0:
The item price is 8.
The first time that has price <= current item price is 4.
Final price = 8 - 4 => 4
Item 1:
The item price is 4.
The first time that has price <= current item price is 2.
Final price = 4 - 2 => 2
Item 2:
The item price is 6.
The first time that has price <= current item price is 2.
Final price = 6 - 2 => 4
Item 3:
The item price is 2.
No item has price <= current item price, no discount.
Final price = 2
Item 4:
The item price is 3.
Since it is the last item, so no discount.
Final price = 3
Example 2
Input: @prices = (1, 2, 3, 4, 5)
Output: (1, 2, 3, 4, 5)
Example 3
Input: @prices = (7, 1, 1, 5)
Output: (6, 0, 1, 5)
Item 0:
The item price is 7.
The first time that has price <= current item price is 1.
Final price = 7 - 1 => 6
Item 1:
The item price is 1.
The first time that has price <= current item price is 1.
Final price = 1 - 1 => 0
Item 2:
The item price is 1.
No item has price <= current item price, so no discount.
Final price = 1
Item 3:
The item price is 5.
Since it is the last item, so no discount.
Final price = 5
Last date to submit the solution 23:59 (UK Time) Sunday 15th June 2025
.