Somme maximale de sous-traits
def maxSubArray(self, nums: List[int]) -> int:
curr_best = overall_best = nums[0]
for i in range(1,len(nums)):
if curr_best>=0:
curr_best = curr_best + nums[i]
else:
curr_best = nums[i]
if curr_best > overall_best:
overall_best = curr_best
return overall_best
Combative Cardinal