Robbie Hatley's Solutions To The Weekly Challenge #231
For those not familiar with "The Weekly Challenge", it is a weekly programming puzzle, usually with two parts, cycling every Sunday. You can find it here: The Weekly Challenge This week (2023-08-20 through 2023-08-26) is weekly challenge #230. Task 1 is as follows: Task 1: Min Max Submitted by: Mohammad S Anwar You are given an array of distinct integers. Write a script to find all elements which are neither minimum nor maximum. Return -1 if you can’t. Example 1: Input: @ints = (3, 2, 1, 4) Output: (3, 2) (The minimum is 1 and maximum is 4 in the given array. So (3, 2) are the elements which are neither min nor max.) Example 2: Input: @ints = (3, 1) Output: -1 (With only two distinct elements, each element is either min or max.) Example 3: Input: @ints = (2, 1, 3) Output: (2) (The minimum is 1 and maximum is 3 in the given array. So the only element that's neither min nor max is 2.) I suppose I could use CPAN, but I feel like rolling my own tonight. Since the...