Advertisement
Guest User

Untitled

a guest
Aug 25th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.28 KB | None | 0 0
  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)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement