Advent of Code 2023 Day 1 Solve

preview_player
Показать описание
Recording of me solving day 1 of Advent of Code 2023 in Python. Finished rank #16 and #23 for each part.

Finish times:
Part 1: 1:01
Part 2: 4:47 (+3:46)

A good start to AOC 2023! Some small hiccups like forgetting to copy my answer to part 1, but no huge time losses aside from the bad approach at the beginning of part 2. Also, I found an answer to my question about whether there was a more clever solution to part 2 in the subreddit solution thread: replacing 'one' with 'one1one', 'two' with 'two2two', and then running the part 1 solution works (credit to u/pred for this!)

0:00 - Part 1
1:16 - Part 2
5:02 - Explanation
Рекомендации по теме
Комментарии
Автор

I had a super hack solution.
I just replaced all instances of strings like "one" and "two" with "on1e" and "tw2o".
Then proceeded to use my normal code for part 1 to solve.

josephadamita
Автор

Thank you, Im a newbie just beginning coding in python and your videos really help out

harrisonh
Автор

There is really no need to find all overlapping words. The best trick I found is to do both a forward search and a reverse search for both '1', '2' etc and 'one', 'two' etc. and keep track of the first and last one on each line

eavdmeer
Автор

I think it's most difficult part one in AoC so far.

Автор

holy my favorite youtuber dropped new vid

christinazhao
Автор

One day I want to be like this guy. Amazing!

sartipablo
Автор

wow good job, please continue uploading these

fernefer
Автор

Thought about the tricky overlap issue off the bat but took me too long to decide out how to deal with it 😢

ProfessorThock
Автор

really enjoyed watching your process here, would love to see day 2, 3

CodeF
Автор

I tried doing the replace trick at first too, and then you notice the overlap and are like "well crap"

echobucket
Автор

Hey man, are you ok? It's not like you to miss two AOC uploads and me and my friends were worried. <3. Congratulations on your day_03 result!

slide
Автор

if you are justice please do not lie... what is the price for YOUR blind eye

ibrainstormibraingaming
Автор

What's the basic scripting you did for scrapping that input file from the website. I am a beginner want to learn this technique

AnmolSoin-kghs
Автор

Is there a way you could make a video breaking down what you're doing for 100% beginners to understand.

WorkingOnData
Автор

Where's the thread you mentioned at the end? Curious to follow that too

GreenEggsPlusHam
Автор

The secret is in "replace"😂😂😂

idrisstafo
Автор

I dont like AoC at all, but nice you solved it. For some reason I got the complete different number as result?!

AndrewTSq