adventofcode/2021/01/part2.pm
2021-12-05 11:44:23 -05:00

18 lines
261 B
Perl

package part2;
use 5.34.0;
use warnings;
use experimental 'signatures';
use List::AllUtils qw/ sum /;
require './part1.pm';
sub solution(@list) {
return part1::solution(
map { my $i = $_; sum map { $list[$i+$_] } 0..2 } 0..$#list-2
);
}
1;