Toot

Written by Felyashono on 2024-12-06 at 21:30

I did Part 1 running the simulation step by step. I leveraged one key insight for Part 2: any new obstacle must be placed somewhere on the original path from Part 1. This reduces the search space from 19K to 5K (approx) tiles, and I brute forced it from there.

And the trick for detecting a loop was being on a previously traversed tile and facing the same direction.

Runtime was around 25 minutes single-threaded on an Apple M1 Pro.

[#]AdventOfCode #Swift

=> More informations about this toot | View the thread | More toots from felyashono@disabled.social

Mentions

Tags

=> View adventofcode tag | View swift tag

Proxy Information
Original URL
gemini://mastogem.picasoft.net/toot/113608007068204270
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
226.430144 milliseconds
Gemini-to-HTML Time
0.514581 milliseconds

This content has been proxied by September (ba2dc).