Max sum subarray


Getting overclocked(2cases) and error(3cases)

Your code’s time complexity is O(n^3) which is not acceptable. For solving this question, we use Kadane’s Algorithm which does this task in O(n) time complexity.


Refer to this link and tell me if you are able to understand it.

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.