Robbie Hatley’s Solutions, in Perl, for The Weekly Challenge #365 (“Alphabet Index Digit Sum” and “Valid Token Counter”)
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-16 through 2026-03-22 is #365. The tasks for challenge #365 are as follows: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Task 365-1: Alphabet Index Digit Sum Submitted by: Mohammad Sajid Anwar You are given a string $str consisting of lowercase English letters, and an integer $k. Write a script to convert a lowercase string into numbers using alphabet positions (a=1 … z=26), concatenate them to form an integer, then compute the sum of its digits repeatedly $k times, returning the final value. Example 1 input: $str = "abc", $k = 1 Expected output: 6 Example 2 input: $str = "az", $k = 2 Expected output: 9 Example 3 input: $str = "cat", $k = 1 Expected output: 6 Example 4 input: $str = "dog...