We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8e19ddb commit b29bf7dCopy full SHA for b29bf7d
0724-find-pivot-index/0724-find-pivot-index.py
@@ -0,0 +1,6 @@
1
+class Solution:
2
+ def pivotIndex(self, nums: List[int]) -> int:
3
+ for i in range(len(nums)):
4
+ if sum(nums[:i]) == sum(nums[i+1:]):
5
+ return i
6
+ return -1
0 commit comments