[2023 Day 1] It is not supposed to ramp up this fast

3 years ago by morrowind to c/advent_of_code

load all comments
silvanocerza 20 points 3 years ago

I was surprised seeing ton of people going for the replace approach. It didn't even cross my mind to edit the string, I went straight for regex for part 1 and it was easy enough to adapt it for part 2.

path: 0 5743643, hotness: undefined, score: 20, children: 2
UndercoverUlrikHD 4 points 3 years ago

On the surface level it makes sense since you already wrote the code to extract the numbers based on digits, which will be in the back of your mind. Once you have some time think about though, it's obvious it's better to just directly find the first and last "digit" without changing the string.

path: 0 5743643 5747903, hotness: undefined, score: 4, children: 0
stifle867 1 point 3 years ago

I did this exact thing and hit the point where it didn't work. I appreciated that the problem broke my code because it made me arrive at a better solution.

path: 0 5743643 5746981, hotness: undefined, score: 1, children: 0
advent_of_code
advent_of_code

@programming.dev

login for more options
1248
184
1

An unofficial home for the advent of code community on programming.dev! Other challenges are also welcome!

Advent of Code is an annual Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like.

Everybody Codes is another collection of programming puzzles with seasonal events.

EC 2025

AoC 2025

Solution Threads

M T W T F S S
1 2 3 4 5 6 7
8 9 10 11 12

Visualisations Megathread

Rules/Guidelines

  • Follow the programming.dev instance rules
  • Keep all content related to advent of code in some way
  • If what youre posting relates to a day, put in brackets the year and then day number in front of the post title (e.g. [2024 Day 10])
  • When an event is running, keep solutions in the solution megathread to avoid the community getting spammed with posts

Relevant Communities

Relevant Links

Credits

Icon base by Lorc under CC BY 3.0 with modifications to add a gradient

console.log('Hello World')

go to feed...