don't accept numbers > 999 for the multiplication command
This commit is contained in:
parent
c9141da37a
commit
d858da19be
1 changed files with 1 additions and 1 deletions
|
|
@ -12,7 +12,7 @@ def get_lines(filename: str) -> list:
|
|||
|
||||
def part1_get_result_sum(lines: list) -> int:
|
||||
result_sum = 0
|
||||
pattern = re.compile(r"mul\((\d+),(\d+)\)")
|
||||
pattern = re.compile(r"mul\((\d{1,3}),(\d{1,3})\)")
|
||||
for line in lines:
|
||||
matches = re.findall(pattern, line)
|
||||
for match in matches:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue