Advent of Code 2024 - Day 3

https://adventofcode.com

This is a thread to discuss Day 3 :slight_smile:

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

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

Part 1

I thought the 2nd part wouldn't be too hard but I've had two attempts so far and failed

[edit]Found the error in my thinking and I've completed Part 2 :slight_smile:

Warning - the sample input changes from Part 1 to Part 2 - I don't consider this a spoiler - just a friendly head's up :slight_smile:

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

ok part 1 was ez

p1

I made a tiny mistake here, look in the block definition of part 2 instead for the correct block :)

(please note the block above sometimes doesnt work unless you have bignums)
also part 2 is so much easier than yesterday's p2, almost done!

EDIT: done:

yay

really? it was the same for me

@cymplecy why

this


in

my part 1

xmul(2,4)%&mul[3,7]!@^do_not_mul(5,5)+mul(32,64]then(mul(11,8)mul(8,5))

my part 2

xmul(2,4)&mul[3,7]!^don't()_mul(5,5)+mul(32,64](mul(11,8)undo()?mul(8,5))

Ahh - your usual bugbear

You need to chill and stop telling people off for doing this :slight_smile:

Plus you need to hide my answer so as not to spoil things for others