c++
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n### c++\n\n# Complexity
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n### c++\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```cpp []\nclass Solution {\npublic:\n    int maxFrequency(vector<int>& nums, int k, int numOperations) {\n        map<int,int>mp;\n        unordered_map<int,int>hash;\n        set<int>points;\n        for(auto &it:nums){\n            hash[it]++;\n            mp[it-k]++;\n            mp[it+k+1]--;\n            points.insert(it);\n            points.insert(it-k);\n            points.insert(it+k+1);\n        }\n        int ans=1;\n        int sum=0;\n        for(auto &it:points){\n            sum+=mp[it];\n            ans=max(ans,hash[it]+min(sum-hash[it],numOperations));\n        }\n        return ans;\n    }\n};\n```
['C++']