

def linear_max_sum(self, A):
    '\n        Break at 0\n        Same as Continuous Subrarry Sum I.\n\n        :param A: an integer array\n        :return: A list of integers includes the index of the first number and the index of the last number\n        '
    ret = Sum(A[0], 0, 0)
    cur = 0
    s = 0
    for (e, v) in enumerate(A):
        cur += v
        if (ret.sum < cur):
            ret = Sum(cur, s, e)
        if (cur < 0):
            s = (e + 1)
            cur = 0
    return ret

dataset/ETHPy150Open algorhythms/LintCode/Continuous Subarray Sum II.py Solution.linear_max_sum/original