]> www.fi.muni.cz Git - aoc.git/blobdiff - 2015/19.pl
Year 2015
[aoc.git] / 2015 / 19.pl
diff --git a/2015/19.pl b/2015/19.pl
new file mode 100755 (executable)
index 0000000..e12aeb5
--- /dev/null
@@ -0,0 +1,15 @@
+#!/usr/bin/perl -w
+
+use v5.16;
+use strict;
+
+my $in = 1321131112;
+
+for (1 .. 40) {
+       my $out = '';
+       1 while $in =~ s/^(.)(\1*)/$out .= (1+length($2)).$1;''/e;
+       say $out;
+       $in = $out;
+}
+say length $in;
+