26 lines
355 B
Perl
26 lines
355 B
Perl
use 5.38.0;
|
|
|
|
package Part1;
|
|
|
|
use List::AllUtils qw/ /;
|
|
|
|
sub parse_line($line) {
|
|
my %data;
|
|
$line =~ s/Game (\d+)://;
|
|
$data{game} = $1;
|
|
|
|
my @entries = split ';', $line;
|
|
|
|
$data{entries} = [
|
|
map { +{ map { /(\d+) (\w+)/; $2 => $1 } split ",", $_ } } @entries
|
|
];
|
|
|
|
return \%data;
|
|
}
|
|
|
|
sub solution_1 ($input) {
|
|
...;
|
|
}
|
|
|
|
1;
|