]> www.fi.muni.cz Git - aoc2021.git/blobdiff - 15.pl
Day 8: permutations and y///;
[aoc2021.git] / 15.pl
diff --git a/15.pl b/15.pl
new file mode 100755 (executable)
index 0000000..8a104b4
--- /dev/null
+++ b/15.pl
@@ -0,0 +1,17 @@
+#!/usr/bin/perl -w
+
+use v5.16;
+
+my $sum;
+while (<>) {
+       chomp;
+       s/.*\| //;
+       $sum += grep { my $x = length; $x == 2 || $x == 3 || $x == 4 || $x == 7; } split /\s+/;
+}
+
+say $sum;
+
+
+
+
+