Advent of Code 2024 - Day 2

https://adventofcode.com

This is a thread to discuss Day 2 :slight_smile:

https://adventofcode.com/2024/day/2

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

Done Part 1 - taking a long time to come with a workable plan for Part 2

Now got some code for Part 2 but although it works for test data - it's failing on my real puzzle data :frowning:

Having to give up on Part 2 - I just can't get the right answer :frowning:

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

. i finished part1 but my school computer wont let me sign in to github

ooffff


btw my solution for some reason added a list with one item, a value of 0, which shouldntve made it in there but whatever I think its fixed

alright I submitted it now that I am at home

Part 1

project

Snap! Build Your Own Blocks

part 2 is so hard ughhh
also I have to transfer my data to an anonymous account so that I can log in at school but ill switch it back when this is about to end
it is (anonymous user #4442142)

omg I did part 2
EDIT (As i was writing this): oh gosh. the code no longer works. I think I deleted something by accident. if anyone knows what happened here and doesnt care about spoilers, please help!

code

Ok nvm I realized I delete a chunk of code that detects the first item. I’ll get around to rewriting it.

I did part 1. For part 2 - just no I'm not doing that lol.

Summary


Part1

My god, part 2 isin't easy

Checked my solution on 2,3,4,7 December and I'm always getting less than the answer. What's wrong?

Part 1

Can you post a link to the project as it's hard to run your script without all the global variables of the project

Runs best in turbo mode

I think it's due to you relying on safe being incremented by 1 if the sequence is valid

And due to floating point rounding errors - this is not always true
Using my puzzle input I got this

spoiler


and 777 onwards should be good sequences