I am confused that how to keep the sum related constraints in mind during solving a questions?

I am familier with the constraints like 1 < T < 100000 but not with these which are given below:-

- the sum of N over all test cases does not exceed 10^5
- the sum of Q over all test cases does not exceed 10^5

1 Like

@code_shoot Don’t worry about these constraints. Just focus on solving the problem. For description, If there are T test cases then their T independent values of N and the sum of these values does not exceed 10^5

P.S: These statements ensure that T is not going to take part in time complexity.

1 Like

But what does it mean by a TLE in #6 sub-task while submitting the solution

Here is the list of CONSTRAINTS:-

- 1≤T,N,Q≤10^5
- 0≤C≤10^9
- |S|=N
- S contains only lowercase English letters
- the sum of N over all test cases does not exceed 10^5
- the sum of Q over all test cases does not exceed 10^5