Easy o(n) solution
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity: o(n)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: o(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution:\n    def numberOfSubarrays(self, nums: List[int], k: int) -> int:\n        result, cur, l, cur_sub = 0, 0, 0, 0\n        for r, v in enumerate(nums):\n            if v % 2 == 1: \n                cur += 1\n                cur_sub = 0\n\n            while cur == k:\n                if nums[l] % 2 == 1:\n                    cur -= 1\n                l += 1\n                cur_sub += 1\n            result += cur_sub\n\n        return result\n\n```
['Python3']