henleyregatta.bsky.social
@henleyregatta.bsky.social
I'd hate for you to think I was claiming an original idea here. If you've looked at any of the AoC community it's one of the "standard patterns" for dealing with this sort of problem (that come up every year!). Still waiting for a Dijkstra's algorithm and a Chinese remainder theorem this year ;-)
December 5, 2025 at 12:37 PM
Handling edge conditions on a map is a lot easier if you can ignore them. Take the "map" you're given, add rows above/below & columns before/after all with 0/null in. Then, use your scanning/summing algo on all elements "within" this border knowing the edges don't count. No more special cases!
December 5, 2025 at 12:29 PM