nice subarrays || c++ || easy
//exactly similar to the problem:subarrays sum equal to given sum(k)\n// we just need to convert odds with 1 and even with 0\n//and find the given sub arrays ha
//exactly similar to the problem:subarrays sum equal to given sum(k)\n// we just need to convert odds with 1 and even with 0\n//and find the given sub arrays having sum k\nUPVOTE IF YOU GET:)\n```\nclass Solution {\npublic:\n    \n    int numberOfSubarrays(vector<int>& a, int k) {\n        int ans=0,sum=0,n=a.size();\n        map<int,int>mp;\n        mp[0]=1;\n        for(int i=0;i<n;i++){\n            sum+=a[i]%2; // converting even with 0 & odd wiht 1;\n            if(mp.find(sum-k)!=mp.end())\n                ans+=mp[sum-k];\n            mp[sum]++;\n        }\n        return ans;\n    }\n};\n\n```
['C', 'C++']