adventofcode/13/1.pl
Yanick Champoux 57d29c68d0 day13
2017-12-13 10:28:31 -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;