# Advent of Code 2024

**URL:** <https://forums.swift.org/t/advent-of-code-2024/76301>\
**Category:** Community Showcase\
**Tags:** adventofcode\
**Created:** [November 30, 2024, 11:46pm UTC](https://forums.swift.org/t/advent-of-code-2024/76301 "2024-11-30T23:46:35Z")\
**Posts on this page:** 1\
**Showing post:** 129

<div class="post-metadata">

**Author:** ![BlueSparrow](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/bluesparrow/32/38500_2.png) [@BlueSparrow](https://forums.swift.org/u/BlueSparrow)\
**Post date:** [December 20, 2024, 9:31pm UTC](https://forums.swift.org/t/advent-of-code-2024/76301/129 "2024-12-20T21:31:37Z")

</div>

> [@gereons](#):
>
> One of the nice effects is that boundary detection can be done with `grid[point] == nil` instead of dealing with `0...max(X|Y)` checks.

I just return a space character. I wouldn't have considered a dictionary, that's clever. I was going to ask about performance, but I don't think grid accesses are a problem with my horrible brute force solutions.

* * *

Speaking of 'horrible brute force solutions' doing these puzzles have given me an appreciation for how easily Swift lets me take a solution and subject all cores to my stupidity.

 ![Screenshot 2024-12-21 at 10.26.14](https://global.discourse-cdn.com/swift/original/3X/3/b/3bd34ce8afdcb9572fa270137d8f30650db556be.png)

Main stumbling block was figuring out that this error message

 ![Screenshot 2024-12-21 at 10.28.37](https://global.discourse-cdn.com/swift/original/3X/0/b/0bbfd0491d7840131210d7f73e32eaaa94a39096.png)

was trying to say "grid is mutable, it might change by the time this task is running". But hey, I've spent enough years writing C++ that I should be used to cryptic error messages at this point. 🙂

* * *

Edit: I left the Ocean Boiler running all morning and got no results.

> **Spoilers for Day 20, part 1**
>
> Of course, once I sat down and thought about what I was doing, I realised that you can just modify the previous graph that the Dijkstra algorithm outputs and it took 9 seconds to get the answer.

---

_[View the full topic](https://forums.swift.org/t/advent-of-code-2024/76301)._
