Robbie Hatley’s Solutions, in Perl, for The Weekly Challenge #355 (“Thousand Separator” and “Mountain Array”)
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-01-05 through 2026-01-11 is #355. The tasks for challenge #355 are as follows: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Task 355-1: Thousand Separator Submitted by: Mohammad Sajid Anwar You are given a positive integer, $int. Write a script to add thousand separator, "," and return as string. Example #1: Input: $int = 123 Output: "123" Example #2: Input: $int = 1234 Output: "1,234" Example #3: Input: $int = 1000000 Output: "1,000,000" Example #4: Input: $int = 1 Output: "1" Example #5: Input: $int = 12345 Output: "12,345" I'll write a subroutine which splits each integer to its decimal digits, then pops each digit from the right end of the array and append...