Robbie Hatley's Solutions To The Weekly Challenge #276
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-06-30 through 2024-07-06 is #276. Its tasks are as follows: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Task 276-1: Complete Day Submitted by: Mohammad Sajid Anwar Given an array of integers, write a script to return the number of pairs that forms a complete day. A complete day is defined as a time duration that is an exact multiple of 24 hours. Example 1 input: [12, 12, 30, 24, 24], Expected output: 2 Pair 1: (12, 12) Pair 2: (24, 24) Example 2 input: [72, 48, 24, 5], Expected output: 3 Pair 1: (72, 48) Pair 2: (72, 24) Pair 3: (48, 24) Example 3 input: [12, 18, 24], Expected output: 0 This is just a matter of using nested 3-part loops to avoid duplicating pairs, then seeing which pairs add up to an integer x such that 0 == x%24. ...