]> www.fi.muni.cz Git - aoc2021.git/blob - 15.pl
Day 16: pretty straightforward parser
[aoc2021.git] / 15.pl
1 #!/usr/bin/perl -w
2
3 use v5.16;
4
5 my %l = map { $_ => 1 } qw(2 3 4 7);
6 my $sum;
7 while (<>) {
8         chomp;
9         s/.*\| //;
10         $sum += grep { $l{length()} } split /\s+/;
11 }
12
13 say $sum;
14
15
16
17
18