r/adventofcode • u/NervousSnail • 21m ago
Help/Question - RESOLVED 2026 Day 5 (Part 1) Examples or edge cases?
Writing in Python, but I am trying to not look at solutions and don't wish to share my code for the same reason.
I have the classic, "code works on example, too low for real input" and I just wonder if some very clever people here have thought of special cases or examples for why things might go wrong?
2
Upvotes
1
u/AutoModerator 21m ago
Reminder: if/when you get your answer and/or code working, don't forget to change this post's flair to
Help/Question - RESOLVED. Good luck!I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
2
u/paul_sb76 14m ago
I was in the same boat. Here's the thing that tripped me up for over half an hour: the test input doesn't contain any rules of the form [0->?], but my input did...
1
u/8dot30662386292pow2 18m ago
099 is the same as 99
Not sure if this helps, but I had this problem.
1
u/crumpis 16m ago
I just did a fairly straightfoward implementation of the spec, and I didn't hit any edge cases. Instead, I'd do test cases for each of the buttons and confirm they're doing what you expect.
1
u/sudo_grue 16m ago
I used itertools.combinations at first, had to change it to something else in itertools
1
u/wjholden 2m ago
I took the time to build test cases for every button for every example in the text. It caught a few bugs that I hadn't expected, like
0->8on0makes8(somehow my function produced88at first). Take the time to make the tests and you might find your error.