Help in constraints

The sum of N over all test cases does not exceed 10^5 how to over come
can anyone explain this with worst case scenario(ex.)

would you mind explaining your doubt with a little more clarity? it’s not making much sense to me, as in what exactly your doubt is

It means, that for each test case, in the given array, it does not exceed the limit 10^5. Indirectly it is asking you to find a solution in O(n) or O(n log n)

if 1<=n<=10^5
and t is 1to 9
and this condition->
The sum of N over all test cases does not exceed 10^5

so now my is algo. is o(t*n) but i am not able to pass all testcase

this one help

It should have passed, may be you can share your code and problem link so we can see to it

i can’t it’s ongoing

Then better try to figure it out yourself

but overall computing time will be O(tn) or O(tn log n)
if there is t testcase
does it will pass on this case.

Please don’t discuss anything related to ongoing contests. Maybe the time complexity of your code is not O(N). Please figure it out by yourself until the contest ends. Then the discussion forum will be there to help you.

1 Like