Skip to content

Commit 84e5d68

Browse files
authored
Update count-subarrays-with-more-ones-than-zeros.py
1 parent 582fd16 commit 84e5d68

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Python/count-subarrays-with-more-ones-than-zeros.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ def subarraysWithMoreZerosThanOnes(self, nums):
1212
"""
1313
MOD = 10**9+7
1414

15-
result = total = same = more = 0
1615
lookup = collections.defaultdict(int)
1716
lookup[0] = 1
17+
result = total = same = more = 0
1818
for x in nums:
1919
total += 1 if x == 1 else -1
2020
new_same = lookup[total]

0 commit comments

Comments
 (0)