Proof that the target value is always 
IntuitionAssume for the sake of contradiction that the target value is t and it is not k distance away from a point.Assume that we adjusted the points n1, n2, .
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
Assume for the sake of contradiction that the target value is t and it is not k distance away from a point. 

Assume that we adjusted the points n1, n2, ..., nx to target t. Consider the smallest point in this set: n1. We know that t is not k distance away from n1, but it also can't be more than k distance away from n1 - otherwise we wouldn't be able to adjust it. So we are sure that t is dist(n1, t) < k. Now push t forward such that t = n1 + k. We know that all the points in the set can still reach t. Why? 

Consider all points that were on the left of t originally(including n1). t is now further away from all these points but the furthest away it is from is n1 and even that is k distance away. So all the points originally on the left of t will still be able to reach t.

What about the points originally on the right of t? t just got closer to these points! So they can still reach t.

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```cpp []
class Solution {
public:
    int maxFrequency(vector<int>& nums, int k, int numOperations) {
        // case 1: assume that people meet on one of the numbers
        sort(nums.begin(), nums.end());
        unordered_map<int, int> freq;
        for(int num : nums){
            freq[num]++;
        }
        // Case 1:
        int left = 0, right = 0, res = 0;
        for(int num : nums){
            // push left up
            while(num - nums[left] > k){
                left++;
            }
            // push right up
            while(right < nums.size() && nums[right] - num <= k){
                right++;
            }
            int numElems = right - left - freq[num];
            res = max(res, min(numElems, numOperations) + freq[num]);
        }
        // Case 2:
        left = 0, right = 0;
        for(int num : nums){
            // push right up
            while(right < nums.size() && nums[right] - num <= 2*k){
                right++;
            }
            int numElems = right - left;
            res = max(res, min(numElems, numOperations));
            left++;
        }
        return res;


        
    }
};
```
['C++']