adventofcode/2017/13/1.pl
2017-12-28 12:14:51 -05:00

17 lines
244 B
Perl

use 5.20.0;
use List::AllUtils qw/ /;
use experimental qw/ signatures postderef /;
my %g = map { split ': ' } <>;
my $score;
for my $g ( keys %g ) {
next if $g % (2*($g{$g}-1));
warn $g;
$score += $g * $g{$g};
}
say $score;