C++ solution
\n// Please, upvote if you like it. Thanks :-)\nint maxFrequency(vector<int>& nums, int k, int numOperations) {\n\tunordered_map<int, int> freq;\n\tmap<int, int
```\n// Please, upvote if you like it. Thanks :-)\nint maxFrequency(vector<int>& nums, int k, int numOperations) {\n\tunordered_map<int, int> freq;\n\tmap<int, int> line;\n\tset<int> p;\n\tfor (const int& n : nums) {\n\t\tfreq[n]++;\n\t\tline[n - k]++;\n\t\tline[n + k + 1]--;\n\t\tp.insert(n - k);\n\t\tp.insert(n);\n\t\tp.insert(n + k + 1);\n\t}\n\tint res = 0, curRes = 0;\n\tfor (const auto& curP : p) {\n\t\tcurRes += line[curP];\n\t\tres = max(res, freq[curP] + min(curRes - freq[curP],\n\t\t\t\t\t\t\t\t\t\tnumOperations));\n\t}\n\treturn res;\n}\n```
['Array', 'C', 'Counting', 'C++']