Robbie Hatley's Solutions, in Perl, for The Weekly Challenge #293 ("Dominos" and "Boomerangs")
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-10-27 through 2024-11-02 is #293. The tasks for challenge #293 are as follows: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Task 293-1: Similar Dominos Submitted by: Mohammad Sajid Anwar You are given a list of dominos, @dominos. Write a script to return the number of dominoes that are "similar" to any other domino. $dominos[i] = [a, b] and $dominos[j] = [c, d] are "similar" if either (a = c and b = d) or (a = d and b = c). Example 1: Input: @dominos = ([1, 3], [3, 1], [2, 4], [6, 8]) Similar Dominos are $dominos[0], $dominos[1], so output is 2. Example 2: Input: @dominos = ([1, 2], [2, 1], [1, 1], [1, 2], [2, 2]) Similar Dominos are $dominos[0], $dominos[1], $dominos[3], so output is 3. This is just a matter of follo...