C++ easy 6 lines of code  🔥 🔥
Intuition\nIf you remember two sum question you can have refrence \uD83D\uDD25 \uD83D\uDD25\nEnjoy !\n\n# UPVOTE IF IT HELPED \n# Code\n\nclass Solution {\npubl
# Intuition\nIf you remember two sum question you can have refrence \uD83D\uDD25 \uD83D\uDD25\nEnjoy !\n\n# UPVOTE IF IT HELPED \n# Code\n```\nclass Solution {\npublic:\n    int numberOfSubarrays(vector<int>& nums, int k) {\n        int i=0 , sum=0 ,count=0;\n        unordered_map<int,int>map;\n        while(i<nums.size()){\n            if(nums[i]%2 != 0) sum+=1;\n            if(sum == k) count++;\n             if(map.find(sum-k) != map.end()) count+=map[sum-k];\n        map[sum]++;\n         i++;\n        }\n        return count;\n    }\n};\n```\n
['C++']