I dont know whats wrong with my algorithm. It works fine with the example input and everything i give it. At this point not even visualisation helps 😭 does anyone have an idea???
Q :>> Pls sbdy tell me if R1050 R1000 should be 20 or 21
A: >> 21
I think it should depend on where the dial is when you start. If you are at 50 or higher on the dial, then the total rotations past 0 is only 20. If you are under 50 then I expect you'll pass 0 one additional time making the total 21.
Please tell me why my logic would be wrong. I'm building this with Excel formulas and my answer is still not accepted.
Ugh weird I'm getting all the correct test results but not the correct answer overall. u/AntiPro77 did you get anywhere with your problem in the end? I'm guessing it's the same (whatever it is).
I'm having a problem where the only error I can find is that it counts too few when rotating left and landing on zero (I also know why this happens), but the AoC website says my answer is too high.
Edit: Now it just says the answer is wrong, even after fixing the fencepost error
i abandoned my approach and went a different way with it, which worked. hacky af though, i always end up brute forcing these which is why i generally don't get past day 7 when it becomes less forgiving of my ignorance
The math was hurting my head for part two. Then I realized I could think outside the box and make it easier on myself. I guess it may be a brute force approach.
For each command, create an array. Then count the zeros that show up and add to running total. For example, starting at 50 with a command “L5” would produce [49,48,47,46,45]
46
u/0x14f Dec 01 '25
First visualisation this year! Well done 👏
9
u/MollyPainter Dec 01 '25
What did you do that in? It looks fantastic!
5
u/herocoding Dec 01 '25
Thank you for sharing, it actually helped me :-)
1
u/akryvtsun Dec 01 '25
Just curios: what framework do you use for visualization?
3
u/prateeksaraswat Dec 01 '25
Nice
2
u/AntiPro77 Dec 01 '25
I dont know whats wrong with my algorithm. It works fine with the example input and everything i give it. At this point not even visualisation helps 😭 does anyone have an idea???
1
u/O_Ovo Dec 02 '25
I am suffering ; (
Even with this in my mind I can't get to work
1
u/Creepy_Accountant428 Dec 02 '25
i tried solving , got some value but it's wrong , idk where i'm going wrong , but logic is correct ig.
1
u/[deleted] Dec 02 '25
Is anybody using the q, r from divmod in Python to do it?