Advent of Code 2023 - Day 5

Опубликовано: 05 Апрель 2026
на канале: Jonathan Paulson
18,081
190

I placed 64th on part 1; 11th on part 2; now 5th overall.

Lost track of time and started 44 seconds late. Oops. It went pretty well, considering.

I'm surprised to see a problem as tricky as part 2 already. I find interval math tough to visualize.

It's a longer video today because I spent a while cleaning up and explaining my solution code. Hopefully that's interesting and/or useful.

I recommend using "inclusive on the left, exclusive on the right" to represent intervals e.g. store [1,2,3] as [1,4). This has some nice properties, like "the length of [a,b) is b-a" and "[a,b) + [b,c) = [a,c)".

Solution: https://github.com/jonathanpaulson/Ad...
Problem: https://adventofcode.com/2023/day/5