Find the maximum sum.

4

1 votes
Problem

Find the contiguous sub-array with maximum sum.

Input:
N = 6
arr[] = {-2,3,4,-1,5,0}
Output:
11
Explanation:
Max subarray sum is 11
of elements (3, 4, -1, 5, 0) which 
is a contiguous subarray.
Time Limit: 10
Memory Limit: 256
Source Limit:
Editor Image

?