Maximum Subarray Sum https://ide.codingblocks.com/s/162163

timelimit reached… suggest a more optimal solution

There is particular approach to solve this solution.
Pls see the kadanes algo
The complexity of kadanes algo is o(n).
So just see the kadanes algo.
If u any further doubt regarding this.
Pls don’t hesitate to ask.
Hope this will help u

Yes i know, havent i used kadanes algo, i looked it up and this is what it showed me, if its not correct ill search it again

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.

Yes please read my last message

the code which u have wriiten on the code ide link

that code is actually a brute force.
u r finding the all the possible subarry and from that u r finding max sum subarr

ur code complx is On2
kadanes algo compx is O n