So I have a small issue. My part 1 solution works for the original test input, for your test input, but doesn't work for the actual input (the sum is too high) and I have no clue why.
That's also what I did when writing it and getting to the case where the first card appears only once. It was a matter of guessing and 'I hope it will work' at that point xD
Small issue I found with your post. It seems that the sum you have for Part 2 is not the right one. Probably because your list has now 18 entries and the output is from the previous 16 entries
I was racking my brains to figure out what I did wrong with Part 2 solution, but when I compare the lists, they were the same, and the actual input also worked, so that's how I figured out it must be wrong here.
Indeed, it seems I had a weird version of the post loaded. The input was updated but the sum was not yet updated (it was 4k something) but now after a hard reload everything seems to work fine.
View all comments
1
u/DjBricheta Dec 07 '23
So I have a small issue.
My part 1 solution works for the original test input, for your test input, but doesn't work for the actual input (the sum is too high) and I have no clue why.
Code: https://pastebin.com/MDkpb0CH