Grid of Characters - Day 03 - Advent of Code 2023
Let’s solve the Advent of Code 2023 Day 3 puzzle in Ruby! In this video, we'll parse a text file representing a gear assembly schematic. We aim to sum the values of all numbers adjacent to marker symbols.
First, we'll break the input into rows and iterate through, identifying symbol locations. Then for each symbol, we'll search neighboring cells for adjacent numbers. By traversing left, we can find the starting digit to extract the full number value.
For part two, we'll adapt our solution to only consider star symbols with exactly two adjacent numbers - representing gear ratios. We'll get the product of these number pairs and sum the ratios.
Advent of Code: https://adventofcode.com/
My Solutions: https://gist.github.com/cjavdev/d15a2a4ffed6c840c2fb28a093e9f927/
Playlist https://www.youtube.com/playlist?list=PLS6F722u-R6KYlGyUv65EFpGKl2Esmurr
#adventofcode #ruby