Advent of Code 2023 - Day 1 - Solving with JavaScript

preview_player
Показать описание


00:00 Intro
01:13 Overview
02:52 Part 1
10:26 Part 2
34:24 Conclusion

Рекомендации по теме
Комментарии
Автор

This is so helpful. I’m very grateful to watch in real time your thought process on solving these challenges. Your expertise is obvious and sharing it with us is very much appreciated! You are like a skilled surgeon looking for the exact right scalpel to use. So insightful and rewarding. Thank you!!!

kerrykreiter
Автор

First time Im doing the AoC. I thougt it was easy to just replace the words to numbers, but there are overlapping ones (such as 'twone' and 'eightwo'), so that made it a bit trickier than expected). Thanks to that now I do know a bit more of how to use lookahead in regex.

markboots_
Автор

It was good being on a live and getting to “see” everyone. What a pleasant holiday surprise!! I was still working on my Network+ TestOut course, so I got bumped to two other streams after. Haha I remembered to follow one for them. 😊

ArtistFormallyKnownasMC
Автор

I’m impressed at how much complexity you can handle. Once my ternary expression goes 2 deep I’m out haha.

I ended up finding all occurrences in the string and creating a tuple with index and the digit. Then just sort the array and pick the first and last and combine them.

jurgentreep
Автор

Glad to see you back CJ! Does this mean we will be getting daily video's for the next 25 days? 😇

nero
Автор

did this recently, hard as shit. I'm 17 and just started getting into javascript heavily. Been programming on and off for years.

Michael
Автор

I was not a fan how they added `oneight` etc, just seemed more annoying than it was worth. Especially since they didn't factor it in properly in their test cases. It had an example, but didn't actually use the numbers in the example result.

mike-
Автор

I'm on it since 3 hours. Bro is doing it in 5 minutes

OMG I did the second part in the first part...

dev_kame
Автор

I generated an array of tuples with the number and the position that it appears, both full writen numbers and algarisms. Then sorted it and grabbed the first and last positions.

To improve the memory handling I load one line per time in memory and perform the operations.

It was hard man. I took about 2 hours to finish this one.

willzin-da-esfiha
Автор

Yo, Long time dude! Welcome back! Love your content

smithshaw
Автор

I wonder why i got a different answer for part 1, and it's correct. Did they change the input file?

sevenstars
Автор

For someone who was there, could you tell me who we raided on Twitch so I can give them a follow? I was busy working and forgot. Then I got bumped to a second stream. 😊

ArtistFormallyKnownasMC
Автор

I did it with regex and my example data is getting parsed correctly but the full dataset isn't correct. So yeah feel like I'm gonna spend hours on the first day since I have some stupid error. xD

edim
Автор

It was painful to watch you make life so difficult for yourself. But fair play for sticking with it!!

StephenSheridanOnline
Автор

IDK why my array is returning like this like having an extra '/r' ...so that's why my values can't be read from end
[ '1abc2\r', '# pqr3stu8vwx\r', '# a1b2c3d4e5f\r', '# treb7uchet' ]

nomorelivin
Автор

Your solution is so hard.
Try. Replace « one » by « o1e » « two » by « t2w » … « seven » « s7n » …
Next replace \D by empty string
Take first take last
2azrwone> 2azt2o1e> 221> 21

That’s all

sebastienrodrigues
Автор

I actually tried to replace all words with numbers and do the same as first part, but still fail :( On PHP with strtr

Operaatoors