Robbie Hatley’s Solutions, in Perl, for The Weekly Challenge #366 (“Count Prefixes” and “Valid Times”)
For those not familiar with "The Weekly Challenge", it is a weekly programming puzzle with two parts, with a new pair of tasks each Monday. You can find it here: The Weekly Challenge The Weekly Challenge for the week of 2026-03-23 through 2026-03-29 is #366. The tasks for challenge #366 are as follows: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Task 366-1: Count Prefixes Submitted by: Mohammad Sajid Anwar You are given an array of words and a string (contains only lowercase English letters). Write a script to return the number of words in the given array that are a prefix of the given string. ( # Example #1 input: [["a", "ap", "app", "apple", "banana"], "apple"], # Expected output: 4 # Example #2 input: [["cat", "dog", "fish"], "bird"], # Expected output: 0 # Example #3 input: [["hello", "he", "hell...