filmov
tv
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.
#adventofcode #ruby
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.
#adventofcode #ruby
lcm, rotate!, and modulo - Day 08 - Advent of Code 2023
Human Calculator Solves World’s Longest Math Problem #shorts
Maths working model, addition, subtraction, multiplication, division
If cycling games were realistic #shorts
Types of Angle || Basic Math || Knowledge And Learning
throttle sensor magnet up down to on off motor...#short# #viral#video...
#bhilai #shortviral #motovlog #raipur #stuntvideo #ridersrepublic #virelvideo #ktm
Gcd And Lcm | Module : Basics of Programming | In English | Python | Video_16
Fraction wheel |kids math activities | fraction activity for kids #earlylearning #kidsactivities
P1--Gear Problem and LCM
Easy explanation on how to handle the brakes! #f1 #f123 #f1game #formula1 #racing #girl
Ikea Friheten Sofa Bed #short
Maths Working Model | DIY Multiplication Wheel | Easy Mathematics #creative #art #diy #fashion
This super small car is further proof that size doesn't matter! 🚗 #cars #vehicles #small
Maths Working Model On Fractions /Fraction Maths TLM / Maths Fraction Working Model / #mathsmodel
Creating a Modular Arithmetic Table From Scratch (with cool patterns)
Salsa Night in IIT Bombay #shorts #salsa #dance #iit #iitbombay #motivation #trending #viral #jee
Is Zn group with respect to addition operation?
IIT Bombay CSE 😍 #shorts #iit #iitbombay
How To Make Sharpy Light
CCTv camera me record bhoot ☠️#ytshort #ghost #youtubeshorts #youtube #reels #shortvideo
Open DC Motor ° Magnet Test #dcmotor #magnet #tech #motor #youtubeshorts
Roman number model idea 💡#youtubeshorts #shorts #viralshorts
2 Train came on Same Tracks 😱 EMERGENCY STOPS #train #shorts
Комментарии