AoC 2024 Day 5: (Not) Transitivinator

Source: Day Day 5: Print Queue

Full solution for today (spoilers!).

Part 1

The input is a list of pairs of the form a|b which defines that b must not come before a, an empty line, and then a list of values a,b,c,d.

For each line that is valid for all given a|b rules, sum the middle number of each list.

read more...