find maximum sum of subarray code example
Example: kadane algorithm with negative numbers included as sum
//Usually Kadene's algorithm is not considered for negative numbers.
int ms,cs;
ms=cs=a[0];
for(int i=1;i
//Usually Kadene's algorithm is not considered for negative numbers.
int ms,cs;
ms=cs=a[0];
for(int i=1;i