Part 1: Find largest rectangle with any two red tiles as corners
Part 2: Rectangle must be entirely within the polygon formed by
red tiles connected by green edges + interior fill
Used coordinate compression + expanded grid flood fill + 2D prefix
sum for O(n²) rectangle validation on huge coordinate ranges.
Turns out two simple heuristics solve the whole problem in 4ms:
1. Does the area fit? No → invalid
2. Are there enough 3x3 spaces for all presents? Yes → valid
But hey, at least we learned how to use Dancing Links for
a problem that didn't need it. The dlx crate thanks us for
the download stats.
Day 10: Indicator light configuration with bitmask brute-force
Day 11: Graph path counting with memoized DFS
- Part 1: Count all paths from 'you' to 'out'
- Part 2: Count paths from 'svr' to 'out' visiting both 'dac' and 'fft'