Max subarray sum not passing test cases


the code is exiting and the error shown is timelimit. can you please explain why? for the sample input, its executing perfectly.

@sans_sehgal hey Sanskar why are you increasing time complexity of the code. you simple do apply a loop and add content of your array to sum this can be done in linear time. please use Kadane’s algorithm only don’t use o(n^3) and o(n) strategy together

@jaiskid https://ide.codingblocks.com/s/86008, this code is showing an error as well

@sans_sehgal hey sanskar you’re incrementing j++ outside the loop so make sure j++ inside of the loop