Python - Two pointer
\nclass Solution:\n    def numberOfSubarrays(self, nums: List[int], k: int) -> int:\n        right ,left = 0,0\n        ans = 0 \n        odd_cnt = 0\n        a
```\nclass Solution:\n    def numberOfSubarrays(self, nums: List[int], k: int) -> int:\n        right ,left = 0,0\n        ans = 0 \n        odd_cnt = 0\n        ans = 0\n        cur_sub_cnt = 0\n        for right in range(len(nums)):\n            \n            if nums[right]%2 == 1:\n                odd_cnt += 1\n                cur_sub_cnt = 0\n                \n            while odd_cnt == k:\n                if nums[left]%2 == 1:\n                    odd_cnt -= 1\n                cur_sub_cnt += 1\n                left += 1\n                \n            ans += cur_sub_cnt\n            \n        return ans  \n```
['Two Pointers', 'Python', 'Python3']