LearnPy Hub
← Arena
IntermediateRating 1400

Exactly k Odd Numbers

Count the blocks of consecutive numbers that contain exactly k odd numbers.

Input

n and k, then n integers.

Output

One integer.

Sample 1

Input
5 3
1 1 2 1 1
Output
2

Sample 2

Input
3 1
2 4 6
Output
0
solution.py
Output appears here
Exactly k Odd Numbers · Python Arena problem · LearnPy Hub