Posts

Showing posts from October, 2025

Robbie Hatley's Solutions, in Perl, for The Weekly Challenge #341 (“Broken Keyboard” and “Reverse Prefix”)

Image
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 2025-09-29 through 2025-10-05 is #341. The tasks for challenge #341 are as follows: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Task 341-1: Broken Keyboard Submitted by: Mohammad Sajid Anwar You are given a string containing English letters only, and you are given a list of broken keys. Write a script to return the total words in the given sentence can be typed completely. Example #1 input: $str = 'Hello World', @keys = ('d') Expected output: 1 Example #2 input: $str = 'apple banana cherry', @keys = ('a', 'e') Expected output: 0 Example #3 input: $str = 'Coding is fun', @keys = () Expected output: 3 Example #4 input: $str = 'The Weekly Challenge', @keys = ('a','...