- Популярные видео
- Авто
- Видео-блоги
- ДТП, аварии
- Для маленьких
- Еда, напитки
- Животные
- Закон и право
- Знаменитости
- Игры
- Искусство
- Комедии
- Красота, мода
- Кулинария, рецепты
- Люди
- Мото
- Музыка
- Мультфильмы
- Наука, технологии
- Новости
- Образование
- Политика
- Праздники
- Приколы
- Природа
- Происшествия
- Путешествия
- Развлечения
- Ржач
- Семья
- Сериалы
- Спорт
- Стиль жизни
- ТВ передачи
- Танцы
- Технологии
- Товары
- Ужасы
- Фильмы
- Шоу-бизнес
- Юмор
lcm, rotate!, and modulo - Day 08 - Advent of Code 2023
Learn how to solve day 8 of Advent of Code 2023 - The Haunted Wasteland - in this Ruby tutorial.
We'll cover:
Parsing the input data into directions and a graph representation
Navigating the graph by rotating through direction turns
Finding paths in the graph from starting to ending nodes
Handling Part 2 where paths start from multiple nodes
Using the modulo operator and lcm method to align ending points
Refactoring to allow re-use for both parts with a block
This solution demonstrates some elegant Ruby data structures and methods like rotate, lcm, and inject to concisely traverse a directed graph. The code walkthrough explains the initial thought process and a failed solution attempt before arriving at the final answer.
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
Видео lcm, rotate!, and modulo - Day 08 - Advent of Code 2023 канала CJ Avilla (cjav_dev)
We'll cover:
Parsing the input data into directions and a graph representation
Navigating the graph by rotating through direction turns
Finding paths in the graph from starting to ending nodes
Handling Part 2 where paths start from multiple nodes
Using the modulo operator and lcm method to align ending points
Refactoring to allow re-use for both parts with a block
This solution demonstrates some elegant Ruby data structures and methods like rotate, lcm, and inject to concisely traverse a directed graph. The code walkthrough explains the initial thought process and a failed solution attempt before arriving at the final answer.
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
Видео lcm, rotate!, and modulo - Day 08 - Advent of Code 2023 канала CJ Avilla (cjav_dev)
Комментарии отсутствуют
Информация о видео
9 декабря 2023 г. 0:00:19
00:25:51
Другие видео канала













![[Livestream] building a sand pile visualization with p5.js](https://i.ytimg.com/vi/iJ_dbJlj42A/default.jpg)


![[live] working on Stripe Samples open source for Stripe Connect](https://i.ytimg.com/vi/7gcxUFQppXk/default.jpg)




