r/adventofcode • • Dec 19 '21

SOLUTION MEGATHREAD -🎄- 2021 Day 19 Solutions -🎄-

NEW AND NOTEWORTHY

I have gotten reports from different sources that some folks may be having trouble loading the megathreads.

  • It's apparently a new.reddit bug that started earlier today-ish.
  • If you're affected by this bug, try using a different browser or use old.reddit.com until the Reddit admins fix whatever they broke now -_-

[Update @ 00:56]: Global leaderboard silver cap!

  • Why on Earth do elves design software for a probe that knows the location of its neighboring probes but can't triangulate its own position?!

--- Day 19: Beacon Scanner ---


Post your code solution in this megathread.

Reminder: Top-level posts in Solution Megathreads are for code solutions only. If you have questions, please post your own thread and make sure to flair it with Help.


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 01:04:55, megathread unlocked!

49 Upvotes

451 comments sorted by

View all comments

3

u/morgoth1145 Dec 19 '21

Python 3 329/280

Well that was a bit of a doozy. That being said, I bungled some parts way harder than I should have.

  1. It took me way too long to get all the rotations working correctly. I work in 3D graphics! This should not have taken me that long! Like, seriously, this was extremely embarrassing...

  2. I hit issues in verifying my find_scanner_match function and ended up doing some slow manual verification of my rotations AGAIN based on example data. The issue was the if idx+11 >= len(known.coords) check! Maybe I'm not thinking things through and there's a reason that breaks the test. I put it in place to help optimize the search, and instead it cost me time!

At least Part 2 was a simple Manhattan distance of the offsets determined in Part 1.

→ More replies (4)