🗓️ Daily LeetCoding Challenge Day 185|| 🔥 JAVA SOL
\n# Code\n\nclass Solution {\n    public int numberOfSubarrays(int[] nums, int k) {\n        int n = nums.length;\n        int[] count = new int[n + 1];\n      
\n# Code\n```\nclass Solution {\n    public int numberOfSubarrays(int[] nums, int k) {\n        int n = nums.length;\n        int[] count = new int[n + 1];\n        count[0] = 1;\n        int result = 0, oddCount = 0;\n        for (int num : nums) {\n            oddCount += num & 1;\n            if (oddCount - k >= 0) {\n                result += count[oddCount - k];\n            }\n            count[oddCount]++;\n        }\n        return result;\n    }\n}\n\n```
['Java']