python beats 99.44%


  • 0
    G

    this is my code:

    class Solution(object):
        def maxSubArray(self, nums):
            maxN=min(nums);sumN=0
            for i in nums:
                if sumN<0:sumN=i
                else:sumN+=i
                if sumN>maxN:maxN=sumN
            return maxN
            
            
    

Log in to reply
 

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