Skip to content

Commit

Permalink
1991
Browse files Browse the repository at this point in the history
  • Loading branch information
isinsuarici committed Feb 13, 2022
1 parent 9a5541d commit 3d79702
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions E_1991_FindtheMiddleIndexinArray.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class Solution:
def findMiddleIndex(self, nums: List[int]) -> int:
for i in range(len(nums)):
if sum(nums[:i])==sum(nums[i+1:]):
return i
return -1

0 comments on commit 3d79702

Please sign in to comment.