Python Binary Search 🔥🔥
BINARY SEARCH !!!\n\n# Code\npython3 []\nclass Solution:\n    def maxFrequency(self, nums: List[int], k: int, numOperations: int) -> int:\n        ans = 1\n    
# BINARY SEARCH !!!\n\n# Code\n```python3 []\nclass Solution:\n    def maxFrequency(self, nums: List[int], k: int, numOperations: int) -> int:\n        ans = 1\n        numscounter = Counter(nums)\n        nums.sort()\n        for i in range(len(nums)):\n            ans = max(ans, numscounter[nums[i]])\n            ind = bisect_right(nums, nums[i]+2*k)\n            ans = max(ans, min(ind-i,numOperations))\n            ind = bisect_left(nums, nums[i]-2*k)\n            ans = max(ans, min(i-ind+1,numOperations))\n            ind1 = bisect_right(nums, nums[i]+k)\n            ind2 = bisect_left(nums, nums[i]-k)\n            ans = max(ans, min(ind1-i+i-ind2,numOperations+numscounter[nums[i]]))\n        return ans\n        \n```
['Binary Search', 'Sorting', 'Python3']