mirror of
https://github.com/autistic-symposium/master-algorithms-py.git
synced 2025-07-01 18:17:02 -04:00
Update pivot_index_array.py
This commit is contained in:
parent
a4fe8d519e
commit
a37d96b756
1 changed files with 2 additions and 4 deletions
|
@ -3,11 +3,9 @@
|
||||||
# author: bt3gl
|
# author: bt3gl
|
||||||
|
|
||||||
|
|
||||||
def pivotIndex(nums):
|
def pivot_index(nums):
|
||||||
|
|
||||||
s = sum(nums)
|
s, left_sum = sum(nums), 0
|
||||||
|
|
||||||
left_sum = 0
|
|
||||||
|
|
||||||
for i, x in enumerate(nums):
|
for i, x in enumerate(nums):
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue