This commit is contained in:
Mhrooz 2024-05-25 18:37:41 +02:00
parent b63eb3ed4d
commit cf972fd868

10
53-240525-pass/main.py Normal file
View File

@ -0,0 +1,10 @@
class Solution:
def maxSubArray(self, nums: List[int]) -> int:
s = [-1e5]
for index, num in enumerate(nums):
val = max(s[index] + num, num)
s.append(val)
ans = -1e5
for num in s:
ans = max(num,ans)
return ans