Robbie Hatley's Solutions To The Weekly Challenge #241
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-10-29 through 2023-11-04) is weekly challenge #241. Task 241-1 is as follows: PROBLEM DESCRIPTION: Task 1: Arithmetic Triplets Submitted by: Mohammad S Anwar Given an array "nums" of 3-or-more integers in increasing order, and a positive integer "diff", write a script to find the number of unique "Arithmetic Triplets", where an "Arithmetic Triplet" is a trio of numbers from nums which satisfies these rules: a) i < j < k b) nums[j] - nums[i] == diff c) nums[k] - nums[j] == diff Example 1: Input: @nums = (0, 1, 4, 6, 7, 10), $diff = 3 Output: 2 Index (1, 2, 4) is an arithmetic triplet because both 7 - 4 == 3 and 4 - 1 == 3. Index (2, 4, 5) is an arithmetic triplet because both 10 - 7 == 3 and 7 - 4 == 3. Example 2: Input: @nums = (4, 5, 6, 7...