Minimum Subarray
Example
Solution
class Solution:
"""
@param nums: a list of integers
@return: A integer denote the sum of minimum subarray
"""
def minSubArray(self, nums):
# write your code here
total, sum = sys.maxint, 0
for num in nums:
sum += num
total = min(total, sum)
sum = min(sum, 0)
return totalLast updated