C++ Sliding Window
\nclass Solution {\npublic:\n    int numberOfSubarrays(vector<int>& nums, int k) {\n        int count = 0;\n        int l = 0;\n        int r = 0;\n        int 
```\nclass Solution {\npublic:\n    int numberOfSubarrays(vector<int>& nums, int k) {\n        int count = 0;\n        int l = 0;\n        int r = 0;\n        int oddCount = 0;\n        int size = nums.size();\n        while (r < size) {\n            while (oddCount < k && r < size) {\n                if (nums[r] % 2 != 0) {\n                    oddCount++;\n                }\n                r++;\n            }\n            int c1 = 1;\n            while (r < size && nums[r] % 2 == 0) {\n                r++;\n                c1++;\n            } \n            int c2 = 0;\n            while (oddCount == k && l < r) {\n                if (nums[l] % 2 != 0) {\n                    oddCount--;\n                }\n                l++;\n                c2++;\n            }\n            count += c1 * c2;\n        }\n        \n        return count;\n    }\n};\n```
['C', 'Sliding Window']