Comments

Yes, I figured out that mistake. But I'm unable to figure out how it worked when I changed ll to int. Also, it works fine in both C++20 and C++23 with ll too.

No. But I am able to figure out that I should've iterated from 0 to counts.size() instead of 0 to n. That must have been the possible reason of encountering a Runtime Error. But I'm unable to understand that why is it working when I change ll to int, even though I'm still iterating from 0 to n.

He's always at his prime! He is the Messi of competitive programming.

Leave it Tourist :)