Robbie Hatley’s Solutions, in Perl, for The Weekly Challenge #398 (“Divisible Average” and “String Difference”)
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-11-02 through 2026-11-08 is #398. The tasks for challenge #398 are as follows: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Task 398-1: Divisible Average Submitted by: Mohammad Sajid Anwar You are given an array of positive integers. Write a script to return the closest integer to the mean value of all even integers that are divisible by 3. If none is divisible, return 0. The phrase "even integers that are divisible by 3" is the same as "integers which are divisible by 6", so I need only test "0 == $int % 6", and if there are some of those, return "floor(mean(@ints)+0.5)", else 0. Robbie Hatley's Perl Solution to The Weekly Challenge 398-1 ~~~~~~~~~~~~~~~~~~~~~~...