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...


Deterministic Shuffling Using Hashes

Whenever I create my yearly reading list, I need a way to order the books. Sure, I could just shuffle them normally, but that leads me to the temptation of cheating and re-shuffling them so that the books I want to read most are first. What I really need is a shuffle that will shuffle the same way every time.

Enter: hashsort

read more...