Grid of Characters - Day 03 - Advent of Code 2023

Поделиться
HTML-код
  • Опубликовано: 8 сен 2024
  • 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: adventofcode.com/
    My Solutions: gist.github.co...
    Playlist • Advent of Code
    #adventofcode #ruby

Комментарии • 3

  • @GreyhoundIT
    @GreyhoundIT 9 месяцев назад

    This years seams to be harder then previous ones. I always struggle with these as i want to use matrix but have no clue

    • @cjav_dev
      @cjav_dev  9 месяцев назад +1

      Yes! The first couple days seem harder to me, too.