Subarray Sum Equals K
If you transform the input array into binary, then the problem becomes the \'Subarray Sum Equals K\' problem. You can think of k odd numbers means sum of then i
If you transform the input array into binary, then the problem becomes the \'Subarray Sum Equals K\' problem. You can think of k odd numbers means sum of then is k.\n\n```\nclass Solution {\npublic:\n    int numberOfSubarrays(vector<int>& nums, int k) {\n        unordered_map<int, int> m;\n        const int n = nums.size();\n        int rst = 0;\n        int acc = 0;\n        m[0] = 1;\n        for (int i = 0; i < n; ++i) {\n            acc += (nums[i]%2);\n            rst += m[acc-k];\n            m[acc]++;\n        }\n        return rst;\n    }\n};\n```
['C']