class Solution: # @param A, a list of integers # @return an integer def maxSubArray(self, A): S=[None for i in range(len(A))] S[0]=A[0] for i in range(1,len(A)): if S[i-1]>0: S[i]=S[i-1]+A[i] else: S[i]=A[i] return max(S)
Sunday, September 7, 2014
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment