initial commit, day 10

This commit is contained in:
Ikatono
2024-12-10 14:36:10 -06:00
commit e9df3737e1
19 changed files with 2157 additions and 0 deletions

15
03a.py Executable file
View File

@@ -0,0 +1,15 @@
#!/usr/bin/python
import re
with open('03a.txt') as f:
text = f.read()
reg = re.compile(r'mul\((?P<num1>[0-9]+),(?P<num2>[0-9]+)\)')
total = 0
for match in reg.finditer(text):
total += int(match.group('num1')) * int(match.group('num2'))
print(total)