mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-19 02:38:12 +08:00
clean of unnecessary checks, imports, calls (#7993)
This commit is contained in:
@ -62,8 +62,7 @@ def max_sub_array(nums: list[int]) -> int:
|
||||
current = 0
|
||||
for i in nums:
|
||||
current += i
|
||||
if current < 0:
|
||||
current = 0
|
||||
current = max(current, 0)
|
||||
best = max(best, current)
|
||||
return best
|
||||
|
||||
|
Reference in New Issue
Block a user