Robbie Hatley’s Solutions, in Perl, for The Weekly Challenge #367 (“Max Odd Binary” and “Conflict Events”)
For those not familiar with "The Weekly Challenge", it is a weekly programming puzzle with two parts, with a new pair of tasks each Monday. You can find it here: The Weekly Challenge The Weekly Challenge for the week of 2026-03-30 through 2026-04-05 is #367. The tasks for challenge #367 are as follows: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Task 367-1: Max Odd Binary Submitted by: Mohammad Sajid Anwar You are given a binary string that has at least one ‘1’. Write a script to rearrange the bits in such a way that the resulting binary number is the maximum odd binary number and return the resulting binary string. The resulting string can have leading zeros. Example 1 Input: $str = "1011" Output: "1101" Example 2 Input: $str = "100" Output: "001" Example 3 Input: $str = "111000" Output: "110001" Example 4 Input: $str = "0101" Output: "1001" Example 5 Input: $str =...