]> www.fi.muni.cz Git - aoc.git/blob - 2022/01.pl
Day 25: examining the input
[aoc.git] / 2022 / 01.pl
1 #!/usr/bin/perl -w
2
3 use v5.36;
4 use strict;
5 use experimental 'multidimensional';
6 use List::Util qw(sum);
7
8 local $/  = "\n\n";
9
10 chomp (my @elves = <>);
11 my $max = 0;
12
13 for my $elf (@elves) {
14         my $s = sum split(/\n/, $elf);
15         $max = $s if $max < $s;
16 }
17
18 say $max;
19