DEV Community

Robert Mion
Robert Mion

Posted on

Beacon Scanner

Advent of Code 2021 Day 19

Solve for X where:

X = the number of beacons

Our input is:

  • A multi-line string

The input represents:

  • A collection of nearly 40 scanners
  • For each one, a list of ~25 x,y,z coordinates...
  • ...one for each beacon's location relative to that scanner...
  • ...and only of the subset of beacons that are positioned within a 1,000 point 3D perimeter

What makes this challenge difficult

  • As stated above, only relative positions are given
  • We don't know the exact positions of any scanners
  • Of the ~25 beacons per scanner, only 12 coordinates will overlap with one other scanner's beacons

What makes this challenge exponentially more difficult

  • Each of the scanners could be in any of 24 rotations and orientations around each of the x,y,z axes

All of the ways I felt intimidated by this challenge

  • The description was the longest encountered in the series thus far, even after Days 23 and 25
  • This reminded me of Day 22, in which I recall throwing in the towel after failing to grasp any sort of possible solution
  • I struggle to visualize 3D areas without having photographic references.
  • The thought of looping through each scanner's coordinate list and comparing each one to every other scanner's full coordinate list seemed inefficient, sloppy and wrong...but I can't think of any other way to solve this
  • The anticipated arithmetic, geometry and physics seemingly involved in calculating distances and validating a variety of object alignments
  • I couldn't even understand the example offered in the instructions, or how the author's conclusions were correct or arrived upon
  • The Reddit Solution Megathread for this day housed comments that confirmed my lack of STEM knowledge likely required to even understand a solution to this challenge, let alone writing an algorithm that could solve it, too

Pressing skip for my own wellbeing

I'm not prepared, or excited, to attempt this puzzle right now.

And since this isn't homework, nor am I being graded - in fact, this is supposed to be a fun project to keep my mind sharp - I vote to skip to the next (nay, previous) day.

Sad face now. But it's important to admit when you're not mentally equipped to attempt a puzzle.

Oldest comments (0)