adventofcode/2024/03/Part1.pm

12 lines
170 B
Perl
Raw Permalink Normal View History

2024-12-04 20:46:05 +00:00
use 5.36.0;
package Day3::Part1;
sub solve($program) {
my $total = 0;
$total += $1 * $2 while $program =~ /mul \( (\d+) , (\d+) \)/xg;
return $total;
}
1;