Robbie Hatley's Solutions, in Perl, for The Weekly Challenge #312 ("Minimum Time" and "Balls and Boxes")
For those not familiar with "The Weekly Challenge", it is a weekly programming puzzle with two parts, cycling every Sunday. You can find it here: The Weekly Challenge The Weekly Challenge for the week of 2025-03-10 through 2025-03-16 is #312. The tasks for challenge #312 are as follows: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Task 312-1: Minimum Time Submitted by: Mohammad Sajid Anwar You are given a typewriter with lowercase english letters a to z arranged in a circle. Typing a character takes 1 second. Moving the pointer one character clockwise or anti-clockwise also takes 1 second. The pointer initially points to a. Write a script to return minimum time it takes to print a given string. Example #1: Input: $str = "abc" Output: 5 The pointer is at 'a' initially. 1 sec - type the letter 'a' 1 sec - move pointer clockwise to 'b' 1 sec - type the letter 'b' 1 sec - move pointer clockwise to 'c...