Robbie Hatley's Solutions To The Weekly Challenge #222
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-06-18 through 2023-06-24) is weekly challenge #222. Task 1 is as follows: "You are given a list of positive integers, @ints. Write a script to find the total matching members after sorting the list increasing order." The word "matching" is a tad vague in that context, but from the first example we can see that it means "the two arrays have the same element at the same index": Example 1: Original list: (1, 1, 4, 2, 1, 2) Sorted list : (1, 1, 1, 2, 3, 4) Comparing the two lists, we found 3 matching members: Index 0, Value 1 Index 1, Value 1 Index 3, Value 2 My solution is to compare the sorted and unsorted versions of each array using a 3-part loop and counting matching elements, like so: Robbie Hatley's Solution to The Weekly Challenge 22...