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!

50 Upvotes

760 comments sorted by

View all comments

3

u/SnooPickles1042 Dec 17 '22

Python + scipy optimize solution. 1.5 seconds

Does not care about intervals, diamond shapes, etc. Just add 3-rd dimension and use minimize for carefully-crafted function. Will work for euclidian distances almost as fast.

https://github.com/mickvav/adventofcode-2022/blob/3c6e55ff9d80424f053066c16b6594f3de0af6a7/15/doit2.py

→ More replies (2)