Skip to content

Commit

Permalink
feat(2024): optimize day 7 - Bridge Repair
Browse files Browse the repository at this point in the history
  • Loading branch information
rpidanny committed Dec 7, 2024
1 parent 05d33ce commit 2c13518
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions 2024/Day07/bridge_repair.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ def is_valid_equation(
result: int,
concat: bool,
) -> bool:
if result > equation[0]:
return False
if idx >= len(equation[1]):
return equation[0] == result
next_val = equation[1][idx]
Expand Down

0 comments on commit 2c13518

Please sign in to comment.