Advent of Code 2023 Day 3: Gear Ratios

preview_player
Показать описание
Very happy with my leaderboard performance today; reached #8 global!

(Disclaimer: I receive commissions on paid memberships through my link, but Codecrafters is not a sponsor of this channel, does not endorse any of my content, and does not review any of my videos.)
Рекомендации по теме
Комментарии
Автор

by looping around the parameter around the parameter of the digit I really struggled transitioning to part 2. I never even thought of looking at a 3 by 3 around the star.
Very insightful and I love your code!

YuumiGamer
Автор

your AoC videos are the best in terms of actually explaining the code's logic. All other channels usually just speed-running the codes to get the result as fast as possible, with minimal explanation in the end.

Thank you for taking the time to explain it very clearly.
You got a sub! Well done Sir!

pietraderdetective
Автор

I started out with scanning the neighbors of the symbols as well, but missed the trick of scanning to the beginning of the number and storing only that to avoid duplicates. I then reworked to start from the numbers. Nice solution, thanks for sharing!

eavdmeer
Автор

Dude, you just saved my day. I spent four hours trying to get somewhere. Finally did it because of this video. Thanks!!

MukilanKrishnakumar
Автор

I made a complete train wreck of part 2 up to the point where I just did a git reset and started again. Got there in the end but a horrifically messy solution that I'm definitely not sharing with anyone!

TheFrogfather
Автор

I love your calm voice and explanation!

smonratt
Автор

I'm just amazed by your coding skills. Amazing, man!

noelomidze
Автор

I was very surprised by your approach. I just simply listed all of the numbers found in the grid and then looked for the adjacent symbols afterwards. Therefore, i was able to store a list of numbers with their adjacent symbols in step two and by putting them in a hash map using the coordinate of the symbol as key I grouped them together to multiply and sum them finally.

zekrodev
Автор

very cool how you treated the case when you have a number all over a *
...1234....

all 3 up neghbours will go at the same start in the set and you dont get duplicate numbers

i used a list and when i got a number and gathered the digits i replaced a digit with . so when i query the next neighbour it will not see it as a number and count it twice

antonioradu
Автор

You said you were discussing the problem on discord. Is it a public discord server?

marttielvisto