DEV Community

Discussion on: Advent of Code 2019 Solution Megathread - Day 3: Crossed Wires

Collapse
 
thibpat profile image
Thibaut Patel

It took me quite a bit of time to solve both problems, but I believe I've implemented a relatively optimized solution:

  1. Parse the input into a list of segments
  2. Detect the overlap between the two wires, segment by segment (only when one wire is vertical and the other is horizontal)