class Solution: def maxSubArray(self, nums: List[int]) -> int: ans = min(nums) count = 0 for i in nums: count+=i if count>ans: ans=count if count<0: count=0 return ans
点赞 评论

相关推荐

牛客网
牛客网在线编程
牛客网题解
牛客企业服务