[C++] Sliding Window
Exactly = atMostK(k) - atMostK(k-1)\n\nint atMostK(vector<int>& a, int k) {\n        int i=0,count = 0,res =0;\n        for(int j=0;j<a.size();j++){\n          
**Exactly = atMostK(k) - atMostK(k-1)**\n```\nint atMostK(vector<int>& a, int k) {\n        int i=0,count = 0,res =0;\n        for(int j=0;j<a.size();j++){\n            if(a[j]%2==1) count++;\n            if(count > k){\n                while(count>k){\n                    if(a[i]%2==1) count--;\n                    i++;\n                }\n            }\n            res += j-i+1;\n        }\n        return res;\n    }\n    \n    int numberOfSubarrays(vector<int>& a, int k) {\n        return atMostK(a,k) - atMostK(a,k-1);\n    }\n```
['C', 'Sliding Window', 'C++']