]> www.fi.muni.cz Git - aoc.git/blob - 2023/04.pl
Day 25: examining the input
[aoc.git] / 2023 / 04.pl
1 #!/usr/bin/perl -w
2
3 use v5.38;
4 use List::Util qw(max);
5
6 my $sum;
7 while (<>) {
8         $sum += max(/ (\d+) red/g)
9                 * max(/ (\d+) green/g)
10                 * max(/ (\d+) blue/g);
11 }
12
13 say $sum;