java || sliding window || two pinter
\nclass Solution {\n    public int numberOfSubarrays(int[] nums, int k) {\n        int i=0;\n        int j=0;\n        int oddCount=0;\n        int count=0;\n  
```\nclass Solution {\n    public int numberOfSubarrays(int[] nums, int k) {\n        int i=0;\n        int j=0;\n        int oddCount=0;\n        int count=0;\n        int temp=0;\n        \n        while(j<nums.length){\n            if(nums[j]%2==1){\n                oddCount++;\n                temp=0;\n            }\n            while(oddCount==k){\n                temp++;\n                if(nums[i]%2==1){\n                    oddCount--;\n                }\n                i++;\n            }\n            count+=temp;\n            j++;\n        }\n        return count;\n    }\n}\n```
['Sliding Window', 'Java']