Robbie Hatley’s Solutions, in Perl, for The Weekly Challenge #391 (“Array Median” and “Arrange Box”)
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-09-14 through 2026-09-20 is #391. The tasks for challenge #391 are as follows: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Task 391-1: Array Median Submitted by: Mohammad Sajid Anwar You are given two sorted arrays of numbers. Write a script to merge the two given sorted arrays and return the median of the merged array. "Merging" is just "my @a3 = sort {$a<=>$b} (@$a1, @$a2);". (Merge Sort won't work, because the problem doesn't state whether the arrays are increasing, decreasing, or going in opposite directions. So I force increasing.) "Median" depends on parity. For an odd number of elements, the median is the middle element. For an even number of elements, the median is one ha...