easy solution in python 3
In this problem only 2 case is possible.\n1. most frequent number will not present in the array , suppose the arr=[11,20,20]  and k=5 and numberofoperation=3 so
In this problem only 2 case is possible.\n1. most frequent number will not present in the array , suppose the arr=[11,20,20]  and k=5 and numberofoperation=3 so one of the optimal number can be 16 which have frequency as 3. on careful analysis we can find that if we are at index i having number as nums[i] we can convert number upto nums[i]+2*K  into same number.\n2. most frequent number is present in array , suppose arr=[5,10,14] and k=5 and number of operation =2 so the target number will be 10 and its frequency will be 3 , so for that we can find the left most and right most index that can be converted to nums[i].\n```\nclass Solution:\n    def maxFrequency(self, nums: List[int], k: int, numo: int) -> int:\n        #sorting of array..\n        nums.sort()\n        # store the frequency of each number...\n        c=Counter(nums)\n        \n        ans=max(c.values())\n        n=len(nums)\n        \n        \n        if numo==0 or ans==n:\n            return ans\n        \n        #if the target number will not be present in nums...\n        for i in range(n):\n            tot=bisect_right(nums,nums[i]+2*k,i,n)\n            #we will take minimum with number of operation beacuse atmost we can only do numo operations.\n            ans=max(ans,min(tot-i,numo))\n        \n        # if the target will be present in array\n        j=0\n        while j<n:\n            #left most index..\n            x=bisect_left(nums,nums[j]-k,0,j)\n            #right most indexx\n            y=bisect_right(nums,nums[j]+k,j,n)\n            # we will subtract frequecy of nums[j] becasue we no need to do any operation to convert them in nums[j] but we will add them in answer.\n            ans=max(ans,min(y-x-c[nums[j]],numo)+c[nums[j]])\n            \n            #if we have processed any nums[j] no need to do for duplicates...\n            l=nums[j]\n            while j<n and nums[j]==l:\n                j+=1\n        \n        return ans\n```\n\nTime complexity-O(nlogn)\nspace complexity-O(n)
['Binary Search', 'Sorting']