Update pivot_index_array.py

This commit is contained in:
marina 2023-08-07 17:35:15 -07:00 committed by GitHub
parent a4fe8d519e
commit a37d96b756
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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):