filmov
tv
partition and inject intersection &:& 👯♂️ - Day 13 - Advent of Code 2023
Показать описание
In this episode, we solve day 13 of Advent of Code 2023, called "Point of Incidence", where we're trying to find lines of symmetry in patterns of dots and pound signs representing mirrors on Lava Island.
First, we parse the input into arrays of character arrays representing each pattern. Then we write some methods to check if a line is symmetrical around a given point, find all points of symmetry on a line, and ultimately find lines of symmetry in a full pattern.
The key is finding the intersection of symmetry points across all lines to pinpoint the overall symmetry. We handle both horizontal and vertical lines of symmetry.
For part 1, we report the number of rows above or columns left of the symmetry lines.
For part 2, we consider smudges - swapping one character in the pattern and rechecking for other valid lines of symmetry. We brute force check all possibilities, collect the new lines, and subtract out ones we already had.
In the end, we arrive at working solutions for both parts, matching the provided examples.
#adventofcode #ruby
First, we parse the input into arrays of character arrays representing each pattern. Then we write some methods to check if a line is symmetrical around a given point, find all points of symmetry on a line, and ultimately find lines of symmetry in a full pattern.
The key is finding the intersection of symmetry points across all lines to pinpoint the overall symmetry. We handle both horizontal and vertical lines of symmetry.
For part 1, we report the number of rows above or columns left of the symmetry lines.
For part 2, we consider smudges - swapping one character in the pattern and rechecking for other valid lines of symmetry. We brute force check all possibilities, collect the new lines, and subtract out ones we already had.
In the end, we arrive at working solutions for both parts, matching the provided examples.
#adventofcode #ruby
partition and inject intersection &:& 👯♂️ - Day 13 - Advent of Code 2023
Partitions of a Set | Set Theory
Union Find in 5 minutes — Data Structures & Algorithms
Multiplication & Addition Rule - Probability - Mutually Exclusive & Independent Events
Zoom session on Partitions, visualizing Cartesian Products, Generalized Unions and intersections
Partitioning
The Art Gallery Problem and Polygon Triangulation (1/4) | Computational Geometry - Lecture 03
Basics of Probability: Unions, Intersections, and Complements
(Abstract Algebra 1) Definition of a Partition
Probability of Mutually Exclusive Events With Venn Diagrams
Insulating a Partition Wall Intersection
Senior Programmers vs Junior Developers #shorts
Goodbye Iron On Edge Banding: the best technique for iron on edge banding #woodworking
1.12 Disjoint Sets Data Structure - Weighted Union and Collapsing Find
Union and Partition
Difference of sets Class 10 #shorts
What is a Partition? (Set Theory)
Framing the ceiling and roof! 2x6 pine boards. DIY Patio Build.
AutoCAD Isometric Drawing Exercise 2s
Sets Notations#sets symbols #Maths#shorts
CNC one side folding and sliding partition doors #new #hyderabad#one side Folding sliding cnc#latest
What happens if I fold this paper 42 times? 🤯
How To FIX BIOS Boot Key NOT WORKING 🖥️💪💥#shorts
05.Boolean Operations & Partitions in COMSOL Multiphysics
Комментарии