Easy || Commented || O(N) Time and O(1) Space || Window Sliding
\nclass Solution {\n   public:\n    int numberOfSubarrays(vector<int>& nums, int k) {\n        int l = 0, r = 0, n = nums.size(), kCount = 0, count = 0, prefix 
```\nclass Solution {\n   public:\n    int numberOfSubarrays(vector<int>& nums, int k) {\n        int l = 0, r = 0, n = nums.size(), kCount = 0, count = 0, prefix = 0;\n        while (r < n) {\n            // increase odd count\n            kCount += (nums[r++] & 1);\n            if (kCount > k) {\n                l++;\n                kCount--;\n                prefix = 0;\n            }\n\n            // Count the number of prefix which is even because either we include them or not still we get the nice one\n            while (l < r && (nums[l] % 2 == 0)) prefix++, l++;\n            if (kCount == k) {\n                count += (1 + prefix);\n            }\n        }\n        return count;\n    }\n};\n```
[]