]> www.fi.muni.cz Git - aoc.git/commitdiff
Day 6: rewrite after misreading the task
authorJan "Yenya" Kasprzak <kas@fi.muni.cz>
Tue, 6 Dec 2022 06:58:33 +0000 (07:58 +0100)
committerJan "Yenya" Kasprzak <kas@fi.muni.cz>
Tue, 6 Dec 2022 06:58:33 +0000 (07:58 +0100)
2022/12a.pl [new file with mode: 0755]

diff --git a/2022/12a.pl b/2022/12a.pl
new file mode 100755 (executable)
index 0000000..52d31de
--- /dev/null
@@ -0,0 +1,11 @@
+#!/usr/bin/perl -w
+
+use v5.36;
+use strict;
+use experimental 'multidimensional';
+
+chomp($_ = <>);
+my $i;
+s/^.//, $i++ while substr($_, 0, 14) =~ /(.).*\1/;
+say $i + 14;
+