adventofcode/2023/02/Part1.pm
2023-12-02 11:17:13 -05:00

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;