Skip to content

Commit 1069b38

Browse files
authored
Update count-number-of-nice-subarrays.py
1 parent a8fa08a commit 1069b38

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Python/count-number-of-nice-subarrays.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ def numberOfSubarrays(self, nums, k):
1010
"""
1111
def atMost(nums, k):
1212
result, left, count = 0, 0, 0
13-
for right in xrange(len(nums)):
14-
count += nums[right]%2
13+
for right, x in enumerate(nums):
14+
count += x%2
1515
while count > k:
1616
count -= nums[left]%2
1717
left += 1

0 commit comments

Comments
 (0)