Fixes LGTM issues (#1745)

* Fixes redefinition of a variable

* Fixes implementing __eq__

* Updates docstring
This commit is contained in:
onlinejudge95
2020-02-11 02:53:19 +05:30
committed by GitHub
parent 80718bd880
commit 6fdd53c676
2 changed files with 21 additions and 11 deletions

View File

@ -6,7 +6,7 @@ def max_subarray_sum(nums: list) -> int:
if not nums:
return 0
n = len(nums)
s = [0] * n
res, s, s_pre = nums[0], nums[0], nums[0]
for i in range(1, n):
s = max(nums[i], s_pre + nums[i])