My solution is also fully deterministic and passes 100% of the test cases. I also rely on two different mathematical operations.
What really caught my attention is the probabilistic angle you mentioned - I’m genuinely curious: how would you even introduce randomness into this puzzle in a meaningful way?
Thanks, but I have to confirm to you that I’m definitely not doing better math than you or @bamilan in this puzzle, I only use comparisons in my solution. I’m genuinely curious about what you’ve done to get a 3.9K solution with 100%
So yes, there is something I know that you don’t, yet (the 3rd step I named long ago)
And the reverse is true. I may try to come up with some of those automated searches of solutions in the future, I have some simple optimization codes but mostly to find local improvements with specific calculations, and in my 100% solution I only had place for 1 of those math tricks that would improve my solution, but that was still at 4616 steps with 100%…
There is some “art” to optimizing luck too but it’s also a totally different game, in theory you could get the absolute minimum by randomly printing either option, but that’s impossible in practice. In my case, I was once close to getting less than 2.4K (I think), but I stopped trying long ago…