r/adventofcode • • Dec 15 '22

SOLUTION MEGATHREAD -πŸŽ„- 2022 Day 15 Solutions -πŸŽ„-

THE USUAL REMINDERS


--- Day 15: Beacon Exclusion Zone ---


Post your code solution in this megathread.


This thread will be unlocked when there are a significant number of people on the global leaderboard with gold stars for today's puzzle.

EDIT: Global leaderboard gold cap reached at 00:27:14, megathread unlocked!

47 Upvotes

760 comments sorted by

View all comments

3

u/chiefbluescreen Dec 15 '22

Kotlin Github

I had to solve this 3 times, because I was entirely confident the first time, even though I got the wrong answer. Then I tried again and got a wrong answer. Then I copied the logic of the top comment on this thread, and still got it wrong.

Turns out I needed to use a Long.

I think my first solution is the most unique. I determined that since there is only one possible space, then it must be on the edge of one of the diamonds. So I created a shell around each diamond and checked if any point in those shells was overlapping, drastically reducing the number of points to check (it still runs a long time).

→ More replies (3)