SHARE
TWEET

Untitled

a guest Aug 25th, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Solution(object):
  2.     def maxSubArray(self, nums):
  3.         """
  4.        :type nums: List[int]
  5.        :rtype: int
  6.        """
  7.         for i in range(1, len(nums)):
  8.             if nums[i-1] >0:
  9.                 nums[i] = nums[i] + nums[i-1]
  10.         return max(nums)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top