Python Solution implementing optimal solution (Kadane's Algorithm)


#1

`class Solution:
# @param A : tuple of integers
# @return an integer
def maxSubArray(self, A):
max_cur = A[0]
max_glo = A[0]
for i in range(1,len(A)):
max_cur = max(A[i],max_cur+A[i])
if max_cur > max_glo:
max_glo = max_cur

    return max_glo`