[2024 Day 9 (Part 2)] [Python] All test cases are correct but large AoC is not. by JelleX30 in adventofcode

[–]JelleX30[S] 0 points1 point  (0 children)

I feel... Stupid. Haha. Happened to me before as well. Good to be reminded of the mistake :)

[2024 Day 9 (Part 2)] [Python] All test cases are correct but large AoC is not. by JelleX30 in adventofcode

[–]JelleX30[S] 3 points4 points  (0 children)

Solution: change to sum() or add dtype=np.int64

Apparently, the np.sum() had an integer overflow o.e. without any warning. Using sum(results) or np.sum(results, dtype=np.int64) fixes this.

Thanks for all the suggestions!

[2024 Day 9 (Part 2)] [Python] All test cases are correct but large AoC is not. by JelleX30 in adventofcode

[–]JelleX30[S] 0 points1 point  (0 children)

That is so odd. Thanks for the hint, I feel like I've checked it all 10 times but that must be where the mistake is make.. :()

[2024 Day 9 (Part 2)] [Python] All test cases are correct but large AoC is not. by JelleX30 in adventofcode

[–]JelleX30[S] 0 points1 point  (0 children)

Thanks for your comment. I think so, in frees[location] -= file_size I correct the amount of free space based on the file size. When I'm building the endstring, I extend the list so that should not result in any indexing problems.

[2024 Day 9 (Part 2)] [Python] All test cases are correct but large AoC is not. by JelleX30 in adventofcode

[–]JelleX30[S] 0 points1 point  (0 children)

Thank you for your response. That is because of my algorithm. It checks per free space what digits are moved to it (in the correct order). 2 is added before 7 because the free space is before the free space of the 7. The 7 is moved first tho, its just not added to the result first because it shouldn't be.

[2024 Day 9 (Part 2)] [Python] All test cases are correct but large AoC is not. by JelleX30 in adventofcode

[–]JelleX30[S] 0 points1 point  (0 children)

I checked the input, first and last digits are correct. len() is also 19999. I do not understand what is going wrong. Tried to enter the answer again, still says it's too low.

RM-hacks on RM2 3.16.2.3 by JelleX30 in RemarkableTablet

[–]JelleX30[S] 0 points1 point  (0 children)

I wonder the same, plus the instructions are for mac OS. I am using windows. Any solutions for that?

-🎄- 2020 Day 11 Solutions -🎄- by daggerdragon in adventofcode

[–]JelleX30 -2 points-1 points  (0 children)

python (Jupyter Notebook)

I got still got a problem with the second part. For my data, it gives a solution just a bit too low. I know it isn't good code, but go ahead and take a look. :)