12 lines
170 B
Perl
12 lines
170 B
Perl
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;
|