@felyashono don’t know if you read Rust, but here’s my solution: https://github.com/teotwaki/aoc/blob/main/2024/06/src/lib.rs
In essence, I have a hashmap with the locations of the obstacles and a hashset of visited locations/direction combo. The hashset is used to detect loops. I add one obstacle on every location along the path and simulate the route again. I remove some path locations as possible candidates by checking if they would send out of bounds.
=> More informations about this toot | View the thread | More toots from teotwaki@mastodon.online
=> View felyashono@disabled.social profile
text/gemini
This content has been proxied by September (3851b).