Improve input parsing

This commit is contained in:
2024-12-08 08:26:25 -08:00
parent b9f544ed1e
commit 569714d227
8 changed files with 19 additions and 18 deletions

View File

@@ -1,12 +1,13 @@
import re
from functools import reduce
test_input_p1 = (
"xmul(2,4)%&mul[3,7]!@^do_not_mul(5,5)+mul(32,64]then(mul(11,8)mul(8,5))"
)
test_input_p2 = (
"xmul(2,4)&mul[3,7]!^don't()_mul(5,5)+mul(32,64](mul(11,8)undo()?mul(8,5))"
)
test_input_p1 = """
xmul(2,4)%&mul[3,7]!@^do_not_mul(5,5)+mul(32,64]then(mul(11,8)mul(8,5))
"""
test_input_p2 = """
xmul(2,4)&mul[3,7]!^don't()_mul(5,5)+mul(32,64](mul(11,8)undo()?mul(8,5))
"""
test_solution_p1 = 161
test_solution_p2 = 48