24
Nov
Challenge 296 solutions in Perl by Matthias Muth These are my Challenge 296 Task 1 and 2 solutions in Perlfor The Weekly Challenge - Perl and Raku. Summary Task 1: String CompressionDetecting runs of same characters? Regular expression!Replacing it by its run-length encoding? In the same statement!Reversing the compression as a BONUS? Even simpler! Task 2: Matchstick SquareA short solution based on a CPAN module works well for the examples and is short, but it doesn't really scale for larger sets of matchsticks.In my own implementation, a 'target sum' iterator selects groups of matchsticks that have the needed length of…