Robbie Hatley’s Solutions, in Perl, for The Weekly Challenge #370 (“Popular Word” and “Scramble String”)
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-04-20 through 2026-04-26 is #370. The tasks for challenge #370 are as follows: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Task 370-1: Popular Word Submitted by: Mohammad Sajid Anwar You are given a string paragraph and an array of banned words. Write a script to return the most popular word that is not banned. It is guaranteed there is at least one word that is not banned and the answer is unique. The words in paragraph are case-insensitive and the answer should be in lowercase. The words cannot contain punctuation symbols. Example #1: Inputs: [ "Bob hit a ball, the hit BALL flew far after it was hit.", ["hit"], ], Output: "ball" After removing punctuation and converting to lower...