Continues from previous week.
Feel free to submit a merge request or open a ticket if you found any issues with this post. We highly appreciate and welcome your feedback.
Additional feedback to the our Perl Weekly Challenge’s Twitter account is much appreciated.
As usual, start with the solution by Nazareno Delucca. The code was easy to follow and pseudocode like. Good for anyone to have a quick idea on how to approach this task. Furthermore, no external CPAN dependencies were used. Likewise with solution by Javier Luque and Laurent Rosenfeld. Then proceed with solution by Adam Russell also opted for simple approach but with difference of using
DateTime::Duration CPAN modules to calculate the duration. Burkhard Nickels also using the same CPAN modules as well.
Instead of just summming up the total time, some participants decided to solve this task with additional rules and constraints. For Duane Powell (make it like the data was obtained from IoT devices) and Saif Ahmed (out-of-sequence data entry and non-contiguous stays).
Solutions that really stood out from the rest. Shortest possible submission by Ruben Westerberg. Totally different approach compares to others using Inversion Lists by E. Choroba. Read his blog post for further details.
Another task which utilizes many different programming techniques used by participants in the past challenges.
And as usual and have been applied by him numerous times in the past challenges, Adam Russell decided to solve this task using a Parser through
Parse::Yapp CPAN module. Read his blog post for further details on its usage. For something slightly different, Burkhard Nickels solved this using available
Math::RPN CPAN module.
Special mentioned of Saif Ahmed which pushed further with additional 50 operators. Likewise for Ryan Thompson which used a generator function to handle all the arity. Read this blog post for more details. Yes, it may be overboard but we love to see every possibilities with Perl.
(1) Lights On! by Adam Russell
(2) Parse::Yapp - Introductory Example by Adam Russell
(3) Reverse Polish Guest Book, Raku Edition by Arne Sommer
(4) Perl Weekly Challenge #39 by Burkhard Nickels
(5) Perl Weekly Challenge 039: Guest Book and Reverse Polish Notation by E.Choroba
(6) Perl Weekly Challenge - 039 by Javier Luque
(7) Perl Weekly Challenge # 39: Guest House and Reverse Polish Notation by Laurent Rosenfeld
(8) Reverse Polish Notation by Ryan Thompson
(9) The times you want to avoid the short cuts. PWC-39 by Saif Ahmed