adventofcode/2023/02/Part2.pm

18 lines
269 B
Perl
Raw Normal View History

2023-12-01 18:03:18 +00:00
use 5.38.0;
package Part2;
use Part1;
2023-12-02 16:41:31 +00:00
use List::AllUtils qw/ min product sum /;
2023-12-01 18:03:18 +00:00
sub solution_2 ($input) {
2023-12-02 16:41:31 +00:00
sum
map { product $_->@{qw/ red blue green /}}
map { Part1::aggregate_entries($_) }
map { Part1::parse_line($_)}
split "\n", $input;
2023-12-01 18:03:18 +00:00
}
1;