adventofcode/2021/05/part2.pm

27 lines
440 B
Perl
Raw Normal View History

2021-12-05 16:45:13 +00:00
package part2;
use 5.20.0;
use warnings;
use experimental 'signatures';
use List::AllUtils qw/ /;
require './part1.pm';
use experimental qw/ signatures postderef /;
use List::AllUtils qw/ any min max sum zip pairmap /;
sub solution(@sample) {
my %grid;
for my $line (@sample) {
for my $step ( part1::steps(@$line) ) {
$grid{$step->[0]}{$step->[1]}++;
}
}
return part1::score(%grid);
}
1;