LOADING: An error occurred. Update Chrome, try Firefox, or visit this post for more details.

⚠️Reddit changed how removals work, which breaks Reveddit's website. Install the extension to track removed content:Add to chromeAdd to firefoxWhat changed?
✖︎
about reveddit
⚙F.A.Q.add-ons
r/
status
copy sharelink
[+] show filters
43
Help/Question[2024 Day 13 Part 2] Example Answer (self.adventofcode)
submitted 1 year, 1 month ago by chad3814 to /r/adventofcode (134.8k)
13 commentsredditother-discussionssubreddit-indexmessage modsop-focus
[–]

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!<.

[–] view less

9 months, 4 weeks ago
—
1 year, 1 month ago
14 of 14

Tip Reveddit Real-Time can notify you when your content is removed.

your account history
(check your username's removed content. why?)
Tip Check if your account has any removed comments.
view my removed comments
[–]MattieShoes7 points1 year, 1 month ago

Haha, I was annoyed by that too!

Mine agrees with the answer you got, FWIW

permalinkauthor-focusas-ofpreserve
[–]cogito-sum2 points1 year, 1 month ago

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?

permalinkhide replies (3)author-focusas-ofpreserve
[–]Extreme_Win_58101 point9 months, 4 weeks ago

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;

permalinkparentcontextauthor-focusas-ofpreserve
[–]nate-developer1 point1 year, 1 month ago

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.

permalinkparentcontextauthor-focusas-ofpreserve
[–][deleted]1 point1 year, 1 month ago

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;
}
permalinkparentcontextas-of
[–]johnwilkonsons1 point1 year, 1 month ago

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

permalinkhide replies (1)author-focusas-ofpreserve
[–]Quantris3 points1 year, 1 month ago

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.

permalinkparentcontexthide replies (1)author-focusas-ofpreserve
[–]jfb13373 points1 year, 1 month ago

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.

permalinkparentcontextauthor-focusas-ofpreserve
[–]prateeksaraswat1 point1 year, 1 month ago

Yeah, it was a bit unclear if the 100 button press limit was still applicable.

permalinkhide replies (1)author-focusas-ofpreserve
[–][deleted]3 points1 year, 1 month ago
[removed] mod/auto

[removed] content loading...

(check your username's removed content. why?)
spin
permalinkparentcontexthide replies (1)as-ofmessage mods
[–]prateeksaraswat1 point1 year, 1 month ago

Many more in the example. But nothing directly said about the puzzle input. I didn’t look at the stats of the individual machines. It is possible that there was a crazy claw machine in there that jumped a billion points at once.

permalinkparentcontextauthor-focusas-ofpreserve
[–]AutoModerator1 point1 year, 1 month 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.

permalinkauthor-focusas-ofpreserve
[–][deleted]0 points1 year, 1 month ago
[deleted] by user
(check your username's removed content. why?)
hide replies (1)as-of
[–]chad38147 points1 year, 1 month ago

This is for the EXAMPLE, not the input. The examples are the same for everyone, just sometimes Eric doesn't provide the answers for the examples in part 2.

permalinkparentcontextauthor-focusas-ofpreserve
r/revedditremoved.substack.com
🚨 NEWS 🚨
✖︎

Important: Reddit Changed How Removals Work

A recent Reddit update makes mod-removed content disappear from profile pages, which breaks Reveddit's website.

Install the browser extension to receive removal alerts.

Add to chromeAdd to firefox

What changed?

r/revedditremoved.substack.com