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

15 lines
192 B
Perl

package part1;
use 5.34.0;
use warnings;
use experimental 'signatures';
use List::AllUtils qw/ sum /;
sub solution(@list) {
return sum map { $list[$_] > $list[$_-1] } 1..$#list;
}
1;