While the problem text said "Now, it is only possible to win a prize on the second and fourth claw machines." It didn't provide what the answer would be. If it helps your testing, the answer is >!875318608908!<.
Tip Reveddit Real-Time can notify you when your content is removed.
Well this is upsetting. I get the same answer as you on the example, but on my puzzle input the answer is too low. Literally no changes between part1 and part2 except adding the extra amount to the prize position.
I assume I'm missing some valid solutions but no idea how. Will see if I can write a test for solvability I guess?
I had the same problem. What helped me was adding validation for the answer. Sometimes, the solution wasn't correct with higher numbers in part two. I just did not count these invalid solutions.
bool isValid = clicksA * aX + clicksB * bX == prizeX && clicksA * aY + clicksB * bY == prizeY;
I had an issue with part two where I was pushing some buttons a negative amount of times to hit certain targets that shouldn't have been hittable...may or may not help you.
I think that doesn't happen on the sample input but did happen on my actual input.
All unique solutions, even for part 2. Check that number of times A and B were pressed are not fractional, and lastly check if you correctly put braces in the equation for calculating presses.
// `consts`:
// a1: [0][0], b1: [1][0], c1: [2][0]
// a2: [0][1], b2: [1][1], c2: [2][1]
// part 2
// a_pressed = {b1*(c2 + CORRECTION) - b2*(c1 + CORRECTION)}/(a2*b1 - a1*b2)
a_pressed = (consts[1][0] * (consts[2][1] + CORRECTION as f64)
- consts[1][1] * (consts[2][0] + CORRECTION as f64))
/ (consts[0][1] * consts[1][0] - consts[0][0] * consts[1][1]);
// b_pressed = {(c1 + CORRECTION) - a1*`a_pressed`}/b1
b_pressed = ((consts[2][0] + CORRECTION as f64) - consts[0][0] * a_pressed) / consts[1][0];
if a_pressed.fract() == 0.0 && b_pressed.fract() == 0.0 {
tokens_2 += 3 * a_pressed as u64 + b_pressed as u64;
}
This is my first time making it this far, is it normal that part 2 doesn't get any example answers anymore? I noticed the same today. That obviously makes it quite a bit trickier to see if the solution is in the right direction
No, this is just due to the nature of these problems I think. I would be surprised if future days don't give you part2 answers for the example.
Yeah, for 11 and 13 its "if you used the naive solution, now you gotta figure out a more efficient way. You can use part 1 as your test case since your improved solution should give the same result"
For day 14 the nature of the problem is that theres a pattern in the input which isn't demonstrated in the example.
Yeah, it was a bit unclear if the 100 button press limit was still applicable.
[removed] content loading...

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.



Haha, I was annoyed by that too!
Mine agrees with the answer you got, FWIW