Kadane's Algorithm

How to find sum of maximum of the subarrays