13 lines
No EOL
206 B
Python
13 lines
No EOL
206 B
Python
import re
|
|
|
|
instruction = re.compile(r"mul\((\d+),(\d+)\)")
|
|
|
|
re.
|
|
data = re.findall(instruction, open("aoc/input.txt", "r").read())
|
|
|
|
total = 0
|
|
|
|
for n1, n2 in data:
|
|
total += int(n1) * int(n2)
|
|
|
|
print(total) |