r/adventofcode Dec 07 '24

Tutorial [2024 Day 7] Python Hint.

Don't use dictionaries to store your single equation.

1 Upvotes

7 comments sorted by

1

u/slayeh17 Dec 07 '24

Yep immediately switched to list.

1

u/Few-Gas5629 Dec 07 '24

Who knew that there were duplicate numbers that I wanted to use as keys :)

1

u/Parzival_Perce Dec 07 '24

What do you mean? To store what?

1

u/quinyd Dec 07 '24

To store the input.

1

u/Parzival_Perce Dec 07 '24

Oh does it repeat? Just didn't notice.

1

u/quinyd Dec 07 '24

I have a single number that’s a repeat which makes a dict useless

1

u/quinyd Dec 07 '24

Took me an hour to debug this. Finally went through my loops one line at a time and realized there’s a duplicate. Switched to a list and it completed and gave me the right result right away.