Why time limit is exceding?

Hey @gagz23

You were starting your loop from i = 1 rather than i = 0. That might have been the issue. Also the code is wrong because you are taking inputs in strings rather than integers. In strings, comparision is done lexographically, because of which 500 will be bigger than 1000 if you take the input in strings, which is not correct. Please take the input in integer variables.

If I was able to answer your query, please mark the doubt as resolved.

https://ide.codingblocks.com/s/315422 but still one test is showing error

Use long long and set max_s to LLONG_MIN. This is being done because negative numbers too can be present in the array.

Hope this helps.

https://ide.codingblocks.com/s/315422 not getting pls tell me.

Your code looks absolutely fine, what is the issue?

runguard: warning: timelimit exceeded (wall time): aborting command runguard: warning: command terminated with signal 15 this error are comiing when i compile and test .

Please send the question link

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.