Hey Everyone

I am not able to understand the significance of this kind of information in the questions

" The sum of all values n over test cases in the test doesn’t exceed 1000. "

and equivalent statement in other questions. Can anybody please explain this to me.

thanks

It means, suppose the value of test case is 100 and N=10^5, then if you iterate, in worst case, it will be O(T*N) = 10^7 iterations which can be easily run in 1 sec.

But it T = 10^5 and N=10^5, then you can’t even iterate over the elements as it would be 10^{10}.

So for this issue, the sum of N over all test cases will not exceed X, so that there won’t be any TLE.

3 Likes