Skip to content

Commit

Permalink
Exclude tickets with a zero value from the part two candidates
Browse files Browse the repository at this point in the history
This was causing an incorrect solution on someone else's input
  • Loading branch information
drewbrew committed Dec 16, 2020
1 parent 9edd5cd commit 5d26446
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Drew/drew_day16.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ def part_two(puzzle_input: str) -> int:
rules = puzzle["rules"]
other_tickets = puzzle["nearby tickets"]
valid_tickets = [
ticket for ticket in other_tickets if not get_invalid_value(ticket, rules)
ticket
for ticket in other_tickets
if 0 not in ticket and not get_invalid_value(ticket, rules)
]
values_by_field = []
# think of this as a very ugly means of transposing a table
Expand Down

0 comments on commit 5d26446

Please # to comment.