adventofcode/2020/06/part1.pm

22 lines
286 B
Perl
Raw Normal View History

2021-12-05 16:51:21 +00:00
package part1;
use 5.20.0;
use warnings;
use Path::Tiny;
use List::AllUtils qw/ sum /;
use experimental qw/
signatures
postderef
/;
sub solution($input) {
return sum map {
my %x = map { $_ => $_ } /(\w)/g;
scalar keys %x;
} split "\n\n", $input;
}
1;