Subarrays with k odds
Your task
Given an integer array a and an integer k, return the number of contiguous subarrays that contain exactly k odd numbers. The array may have length 1; k is non-negative.
Examples
count_nice_subarrays(a: list[int], k: int) -> intExample 1
Input
count_nice_subarrays([1, 1, 2, 1, 1], 3)Output
2