Perl Weekly Challenge 72: One-Liners for Trailing Zeros and Line Ranges
These are some answers to the Week 72 of the Perl Weekly Challenge organized by Mohammad S. Anwar.
Spoiler Alert: This weekly challenge deadline is due in a few hours. This blog post offers some solutions to this challenge, please don’t read on if you intend to complete the challenge on your own.
Since both tasks in this week challenge are quite simple, I decided to use only one-liners to solve each task, both in Raku and in Perl.
Task 1: Trailing Zeros
You are given a positive integer $N (<= 10).
Write a script to print number of trailing zeroes in $N!.
Example 1:
Input: $N = 10
Output: 2 as $N! = 3628800 has 2 trailing zeroes
Example 2
Input: $N = 7
Output: 1 as $N! = 5040 has 1 trailing zero
Example 3:

