3
votes
Day 3: Foggy Forest
Today's problem description: https://adventofcode.com/2026/day/3
Please post your solutions in your own top-level comment. Here's a template you can copy-paste into your comment to format it nicely, with the code collapsed by default inside an expandable section with syntax highlighting (you can replace python with any of the "short names" listed in this page of supported languages):
<details>
<summary>Part 1</summary>
```python
Your code here.
```
</details>
Probably this could be optimized further, but it runs fast enough that I don't think I'll bother. My initial solution was an even slower version of the same approach that took several seconds to run. I'm not doing anything clever here, just bruteforcing all the possible squares and counting the valid ones. There's almost certainly a more elegant way to do this, but I couldn't think of it for whatever reason.
Solution (Lily)
I haven't started coding this (will probably get to it during lunch time) but at first glance, this seems like a significant step up in difficulty/complexity compared to the previous two days.
I can think of a few brute force methods (O(n^2)), but nothing efficient.
I got through part 1 this morning, but I’m still working on part 2.
I think the specific geometries in play can really speed things up, but I feel like there are a lot of specific edge cases.