原题
1 class Solution:
2 def pivotIndex(self, nums: List[int]) -> int:
3 s = sum(nums)
4 left = 0
5 for i,num in enumerate(nums):
6 if 2 * left == s - num:return i
7 left += num
8 return -1
标签:return,nums,int,力扣,索引,724,num,enumerate,left
来源: https://www.cnblogs.com/lj95/p/14341583.html