Robbie Hatley’s Solutions, in Perl, for The Weekly Challenge #396 (“Finishing Order” and “Trionic Array”)
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-10-19 through 2026-10-25 is #396. The tasks for challenge #396 are as follows: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Task 396-1: Finishing Order Submitted by: Mohammad Sajid Anwar You are given two array of integers, @order and @friends. @order (size n) contains every integer from 1 to n exactly once. @friends contains IDs in sorted in strictly increasing order. Write a script to return the IDs in finishing order. To solve this problem, I use a hash %h with keys being the values of @order and values being the corresponding indexes of @order. I then just sort @friends by {$h{$a} $h{$b}}. Robbie Hatley's Perl Solution to The Weekly Challenge 396-1 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...