mirror of
https://github.com/autistic-symposium/master-algorithms-py.git
synced 2025-04-29 20:26:07 -04:00
Update pivot_index_array.py
This commit is contained in:
parent
a4fe8d519e
commit
a37d96b756
@ -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…
x
Reference in New Issue
Block a user