Solved Kadane's alogirithm for finding max sum of largest sub array