Map Intuitive Approach!!
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int func(vector<int>& v, int l, int r) {\n        return upper_bound(v.begin(), v.end(), r) - lower_bound(v.begin(), v.end(), l);\n    }\n    \n    int maximizeWin(vector<int>& v, int k) {\n        map<int, int> ma;\n        for(auto it : v) {\n            ma[it]++;\n        }\n        vector<int> w;\n        for(auto it : ma) {\n            w.push_back(it.first);\n        }\n        int n = w.size();\n        int maxi = 0;\n        int maxi_prev = 0;\n        for(int i = n - 1; i >= 0; i--) {\n            maxi = max(maxi, maxi_prev + func(v, w[i] - k, w[i]));\n            maxi_prev = max(maxi_prev, func(v, w[i], w[i] + k));\n        }\n        return maxi;\n    }\n};\n\n```
['C++']