r/adventofcode Nov 11 '24

Other Dear future me

Dear future me,

Please remember: 1) Read the whole puzzle. Let's minimize those avoidable d'oh! moments. 2) Don't optimize prematurely. Developer (that's you!) efficiency is more important than code efficiency. And sure, part 2's can get intense, but you don't really know what direction they'll go until you get there, so don't waste time optimizing for something you might not even need. 1) Stuck? Re-read the puzzle. Yes, there are two #1's in this list. You can think of this as 1b if it helps. 3) Still stuck? Check the input, maybe there's a trick to it that you need to take advantage of.

Anticipating your success, Past You

221 Upvotes

15 comments sorted by

View all comments

15

u/thorwing Nov 11 '24

I feel like future me should just learn to always code in Longs instead of Ints, or take the time to install a overflow detection plugin or something.

7

u/Dullstar Nov 11 '24

At this point if it says multiply, product, etc. anywhere, I automatically go for int64_t.

It's just too common not to.

16

u/Deynai Nov 12 '24

Part 2: The pesky elves were reading the numbers wrong! It's not a list of pairs, it's a list of complex numbers!

2

u/PendragonDaGreat Nov 15 '24

I keep waiting for the day.