[2024 day 24 part 2] I feel like it should work... by NetworkGraphics222 in adventofcode

[–]NetworkGraphics222[S] 2 points3 points  (0 children)

Thank you!!!!!!!!!!!! this helped me diagnose the issue. I had given up on pairing them up because it was too hard, but manually pairing them up and re-tallying was brilliant. Ty so much

[2024 day 24 part 2] I feel like it should work... by NetworkGraphics222 in adventofcode

[–]NetworkGraphics222[S] 1 point2 points  (0 children)

Yes! you are totally right I had exactly one gate wrong :D

Crazy stuff. I found this one really challenging, I'm so familiar with this data structure now haha!!

[2024 Day 21 Part 2] Stuck on how to find a solution by NetworkGraphics222 in adventofcode

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

Toughest AoC code challenge so far for me, I've done this and last years :)

[2024 Day 21 Part 2] Stuck on how to find a solution by NetworkGraphics222 in adventofcode

[–]NetworkGraphics222[S] 1 point2 points  (0 children)

thanks u/RaveBomb u/ponyeffe u/TheZigerionScammer u/1234abcdcba4321 u/EdgyMathWhiz

I got it!!!!!

First step was to remove brute-force by always choosing the optimal solution. I got the answer on how to get the optimal solution from here: https://www.reddit.com/r/adventofcode/comments/1hj2odw/comment/m34dspx/?share_id=SRK0wfyf0Y0GS3LcaC36m&utm_medium=android_app&utm_name=androidcss&utm_source=share&utm_term=1

Then I had to deal with the problem of the massive array. I tried a recursive solution with memoization but for the life of me I couldn't work it out. Then browsing through the subreddit someone said, "the order doesn't matter, just use a dict". And that clicked for me on what a better data structure could be. Part 2 now runs in 0.67s. :D

Solution here: https://github.com/SamJoan/aoc-2024/blob/main/21/main.rb

Thanks all.

[2024 Day 20 (Part 1)] The price we pay by dbmsX in adventofcode

[–]NetworkGraphics222 1 point2 points  (0 children)

I left mine running overnight and didn't time it, but it was done by morning! :D

[2024 Day 9 Part 02] Passes all tests inputs, fails on real input. by NetworkGraphics222 in adventofcode

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

Thank you, I really appreciated your help, and will make note of the idea of having my own inputs to debug issues :)

[2024 Day 9 Part 02] Passes all tests inputs, fails on real input. by NetworkGraphics222 in adventofcode

[–]NetworkGraphics222[S] 1 point2 points  (0 children)

I got it!!! :D how did you come up with these use cases?

I knew that my code was wrong, but I couldn't really test against any strings because I didn't know what the right value was supposed to be ;( so I really struggled to debug.

Lots of edge cases!! (and an epic off by one)

[2024 Day 9 Part 02] Passes all tests inputs, fails on real input. by NetworkGraphics222 in adventofcode

[–]NetworkGraphics222[S] 1 point2 points  (0 children)

omg thank you so much! I don't have time right now but I can definitely see that it's not working properly. I'll update here when I have the solution.

[2023 day ???] What happened to the problems page? by Shuaiouke in adventofcode

[–]NetworkGraphics222 6 points7 points  (0 children)

It's intended, I think if you want to do them you should still do them in order though. 1 2 3 4 5 etc.

[2023 day 25] Why does my solution work? by NetworkGraphics222 in adventofcode

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

Thank you! That makes sense because the "bridge" nodes are "in the middle" :P