adventofcode/2020/06/part2.pm
2021-12-05 11:51:21 -05:00

19 lines
333 B
Perl

package part2;
use 5.20.0;
use warnings;
use List::AllUtils qw/ sum reduce /;
use Set::Object qw/ set /;
use experimental qw/ signatures postderef /;
sub solution($input) {
return sum map {
my $answers = reduce { $a * $b } map { set( split '' ) } split "\n";
$answers->size;
} split "\n\n", $input;
}
1;