Update main.py
This commit is contained in:
parent
42d3c90d44
commit
4902fa69c4
1 changed files with 10 additions and 4 deletions
|
@ -49,8 +49,11 @@ def one(instr: str):
|
|||
cases = parse(instr)
|
||||
return reduce(
|
||||
lambda x, y: x + y,
|
||||
(target if solve(target, numbers, use_concat=False) else 0 for (target, numbers) in cases),
|
||||
0
|
||||
(
|
||||
target if solve(target, numbers, use_concat=False) else 0
|
||||
for (target, numbers) in cases
|
||||
),
|
||||
0,
|
||||
)
|
||||
|
||||
|
||||
|
@ -58,8 +61,11 @@ def two(instr: str):
|
|||
cases = parse(instr)
|
||||
return reduce(
|
||||
lambda x, y: x + y,
|
||||
(target if solve(target, numbers, use_concat=True) else 0 for (target, numbers) in cases),
|
||||
0
|
||||
(
|
||||
target if solve(target, numbers, use_concat=True) else 0
|
||||
for (target, numbers) in cases
|
||||
),
|
||||
0,
|
||||
)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue