Where is it going wrong. The compile and test is giving right results but it is not getting submitted.
Maximum Subarray Sum
you need to solve this question using O(n) approach rather than O(n^3) which you’ve used please read about kadane’s algorithm before you attempt this question.
It is in n^2. I guess but that is the best approach which is taught. For having more than one test case one loop will be there and for one test case one loop will be there. How to decrease it?
Prateek bhaiaya has also taught about O(n) approach.
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.