Advent of Code 2023 - Day 1

https://adventofcode.com

This is a thread to discuss Day 1 (which started on 1st December at 05:00 UTC ) :slight_smile:

https://adventofcode.com/2023/day/1

REMEMBER!
It is VERY important NOT to write any public spoilers :slight_smile:
ALWAYS keep spoiler stuff hidden inside one of these

Summary

This text will be hidden

which you can obtain by clicking on the gear icon

image

Good luck :slight_smile:
FYI one of the features of Advent of Code is that we all get given different inputs so our answers will be different.
The examples are all the same but each of us gets different inputs for us to solve

I manged to do the 1st part in 10 minutes - a new record for me :slight_smile:

Part 1

image

But this years Day 1 part 2 is going to take quite a big longer!
[edit] 10:00UTC I manged to get the right result from the test data but I've not got the right result using my data! This is worst thing to happen and it's going to take quite a big of debugging to see why there is this discrepancy :frowning:
[edit] 11:18 UTC - found my error - just need to come up with solution :slight_smile:

Finally managed it :slight_smile:

I might just stick to part 1s this year :slight_smile:

Part 2

https://snap.berkeley.edu/snap/snap.html#present:Username=cymplecy&ProjectName=aoc23Day1

Part 1 was very easy, but part 2 really made me think. I mean, I was able to get the correct answer for the example, but not for my actual input. I had to spend a while trying to figure out how to debug it.

Part 1

Part 2

Project (although you can just drag and drop the script images into snap, and then just set the "input" variable.)

Snap! Build Your Own Blocks

If anyone wants to, you can join the snap leaderboard just go here, then enter 1492847-2e9c76cd.

this is my first time doing aoc, got part 1 in 5-10 minutes

part 1

untitled script pic (36)

i made part 2, but its really slow and i dont wanna wait for it to finish so i guess no star for me

Part 2

Your part 2 looks much more elegant than mine :slight_smile:

The best part is, it was mostly made on an ipad.

Part 1 ... working on Part 2.

Part 1

untitled script pic - 2023-12-01T132430.092

Its a bit tricky - certainly the hardest Day 1 part 2 ever!

I thought I could

Advent of Code 2023 script pic

but I keep getting the wrong answer. Hmmm...

We all did when we first ran it on real data :frowning:

In other news - I saw someone toot something and I've adapted it to Snap! and now included it in my project above

The person was very clever to come up with it :slight_smile:

I just looked at it, and it is very clever. I wish I thought of that.

Starting this 23:07 UTC

part 2 is not easy

for part 2, i had to devlop this block (return a list of found positions)

new block

advent of code-2023-day01 script pic
advent of code-2023-day01 script pic (1)

I think this block could be more elegant if it used recursion but I can't figure out how to do that in this specific case

project

project

Yep, I've made one of those and I noticed @ego-lay_atman-bay had as well

That's escalated quickly !

I was originally using the position of block in the strings multiline input library, but then I ran into an issue where there were repeated numbers, so I had to make a positions of block (and I really like how clever I made it).

I'm late to the party...

Project


AoC23_1 script pic (1)