Robbie Hatley's Solutions To The Weekly Challenge #279
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 2024-07-21 through 2024-07-27 is #279. Its tasks are as follows: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Task 279-1: Sort Letters Submitted by: Mohammad Sajid Anwar Given two arrays, @letters and @weights, write a script to sort @letters based on @weights. Example 1: Input: @letters = ('R', 'E', 'P', 'L') @weights = (3, 2, 1, 4) Output: PERL Example 2: Input: @letters = ('A', 'U', 'R', 'K') @weights = (2, 4, 1, 3) Output: RAKU Example 3: Input: @letters = ('O', 'H', 'Y', 'N', 'P', 'T') @weights = (5, 4, 2, 6, 1, 3) Output: PYTHON I use List::MoreUtils::Zip6 to make a list of [letter, weight] pairs, sort those