adventofcode/2023/02/Part1.pm

26 lines
355 B
Perl
Raw Normal View History

2023-12-01 18:03:18 +00:00
use 5.38.0;
package Part1;
use List::AllUtils qw/ /;
2023-12-02 16:17:13 +00:00
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;
}
2023-12-01 18:03:18 +00:00
sub solution_1 ($input) {
...;
}
1;