Max sum subarray

the loop for input is not working

@utkarsh2504
because you used ‘i’ to run as a counter for the test case and same ‘i’ to take the inputs.

yes it worked thanks for assistance can u explain how does it affect the code

initially for first test case i = 0, then you take the input from i = 0 to i = n-1, then i becomes n,
so now for the next testcase it will check if i<t . and it might return false and terminate the loop.

oh thnx for assistance got my mistake

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.