]> www.fi.muni.cz Git - aoc.git/blobdiff - 2020/7.pl
Moved 2020 to a subdir
[aoc.git] / 2020 / 7.pl
diff --git a/2020/7.pl b/2020/7.pl
new file mode 100755 (executable)
index 0000000..d6147c3
--- /dev/null
+++ b/2020/7.pl
@@ -0,0 +1,16 @@
+#!/usr/bin/perl -w
+
+use strict;
+
+$/ = "\n\n";
+
+my $valid = 0;
+while (<>) {
+       $valid++ if (
+               grep { /^(?:byr|iyr|eyr|hgt|hcl|ecl|pid):/ }
+               split /\s+/
+       ) == 7;
+}
+
+print "Valid: $valid\n";
+