A live coding session solving Advent of Code 2025 Day 9 in Rust. Part one involves finding the largest rectangle area from a list of red tile coordinates, with a subtle off-by-one in the dimension calculation. Part two adds constraints: the rectangle must only contain red or green tiles (tiles forming a closed loop), requiring validation that no line segment of the loop crosses into the rectangle. The streamer visualizes the input using Bevy and discovers the shape is a circle, simplifying the problem significantly. Instead of brute-forcing 4.7 billion interior points with a point-in-polygon raycast, the solution checks whether any line segment of the loop falls outside the rectangle's bounding box, making it efficient. Also briefly discusses union-find crates and Kruskal's algorithm from the previous day's problem.

29m watch time