Python kadane's soln


#1
def maxSubArray(self, A):
	l = len(A)
	max_here = 0
	max_so = 0
	if max(A)<0:
	    return max(A)
	for i in range(0,l):
		if (max_here + A[i])>0:
			max_here += A[i]
			max_so = max(max_so,max_here)
		else:
			max_here = 0
	return (max_so)