2 lines python solution


  • 11
    F
    class Solution(object):
    def maxSubArray(self, nums):
        for i in xrange(1,len(nums)):nums[i]=max(nums[i], nums[i]+nums[i-1])
        return max(nums)

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.