adventofcode/2021/01/part1.pm

15 lines
192 B
Perl
Raw Normal View History

2021-12-05 16:44:23 +00:00
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;