Binary Search
Code\npython3 []\nclass Solution:\n    def maxFrequency(self, nums: List[int], k: int, numOperations: int) -> int:\n        nums.sort()\n        freq = Counter(
# Code\n```python3 []\nclass Solution:\n    def maxFrequency(self, nums: List[int], k: int, numOperations: int) -> int:\n        nums.sort()\n        freq = Counter(nums)\n        res = max(freq.values())\n        for a in freq:\n            for b in [a-k,a,a+k]:\n                i = bisect.bisect_left(nums,b-k)\n                j = bisect.bisect_right(nums,b+k)\n                M = j-i-freq[b]\n                res = max(res,freq[b]+min(numOperations,M))\n        return res\n\n\n        \n```
['Binary Search', 'Python3']