Robbie Hatley's Solutions, in Perl, for The Weekly Challenge #350 (“Good Substrings” and “Shuffle Pairs”)
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-12-01 through 2025-12-07 is #350. The tasks for challenge #350 are as follows: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Task 350-1: Good Substrings Submitted by: Mohammad Sajid Anwar You are given a string. Write a script to return the number of good substrings of length three in the given string. A string is good if there are no repeated characters. Example #1: Input: $str = "abcaefg" Output: 5 Good substrings of length 3: abc, bca, cae, aef and efg Example #2: Input: $str = "xyzzabc" Output: 3 Good substrings of length 3: "xyz", "zab" and "abc" Example #3: Input: $str = "aababc" Output: 1 Good substrings of length 3: "abc" Example #4: Input: $str = ...