Robbie Hatley's Solutions To The Weekly Challenge #245
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 This week (2023-11-26 through 2023-12-02) is weekly challenge #245. Its tasks are as follows: Task 245-1: Sort Language Submitted by: Mohammad S Anwar You are given two arrays: one of languages and the other of their popularities. Write a script to sort the languages based on their popularities. Example 1: Input: @lang = ('perl', 'c', 'python'); @popularity = (2, 1, 3); Output: ('c', 'perl', 'python') Example 2: Input: @lang = ('c++', 'haskell', 'java'); @popularity = (1, 3, 2); Output: ('c++', 'java', 'haskell') I tried solving this problem by "zipping" the two arrays together to make an array of [language, popularity] pairs, then sorting that array numerically by the second elements of the pairs;...