]> www.fi.muni.cz Git - aoc.git/blob - 2015/19.pl
Day 25: examining the input
[aoc.git] / 2015 / 19.pl
1 #!/usr/bin/perl -w
2
3 use v5.16;
4 use strict;
5
6 my $in = 1321131112;
7
8 for (1 .. 40) {
9         my $out = '';
10         1 while $in =~ s/^(.)(\1*)/$out .= (1+length($2)).$1;''/e;
11         say $out;
12         $in = $out;
13 }
14 say length $in;
15