I have been trying to submit the solution for maximum subarray sum problem. It always shows the output as:
TESTCASE #1: run-error (Time: 0 s)
The code is running fine on my compiler and on the coding blocks ide and giving the desired output as well.
I used Kadane’s algorithm which has a linear complexity.
Maximum Subarray Sum - code not running
read the given constraint in the problem carefully. you’re declaring array of size 1000 but in the question size may be vary from 0 <= A[i] <= 100000000. I have corrected your code you can refer this.