Usually when it says “wrong answer,” I double check everything because I know something is wrong. But in this case, on my last submission I had, what I believe, to be perfect answers.
I went through the difficulty of checking test cases 4-10, by hand, which was quite boring. And yes, they were all correct.
Not only that, but I used a much slower algorithm (which I am extremely confident of), which was also consistent, for much higher test cases.
The only possible explanation is, maybe, I’m missing something about the problem.