the sum of N over all test cases does not exceed

what is the meaning of this constraint and how to solve it … i do not understand this, please help.

12 Likes

This limit gives you some idea of how fast your method needs to be. Suppose there are up to T = 1000 test cases, in each of which there are up to N = 10^5 items. Without further limits, your solution would need to be able to handle up to T * N = 10^8 items within the time limit. But if you are told that the sum of N over all test cases does not exceed 10^5, then your solution only needs to be fast enough to cover this number of items all together. There may be 1 test case with 10^5 items, or 1000 test cases with an average of 100 items in each test, or any appropriate combination.

67 Likes

how to write this in code any example
.

1 Like