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