Explained - with dry run || Very simple & easy to understand
Intuition\n- Need to track the left side of median is to be subtracted and the right side to the median should be added.\n- So at any point of time with i & j, 
# Intuition\n- Need to track the left side of median is to be subtracted and the right side to the median should be added.\n- So at any point of time with i & j, all the items less than (i+j)/2 should be subtracted where as item above (i+j)/2 should be added to the operation count\n\n\n# Approach\n- First sort the array \n- As per the intuition, we keep on adding nums[j] and subtracting nums[(i+j)/2] with the operation count\n- Check if the operation count is more than k then update i until operation count less than k\n\n\n<b><b>Here I tried some wiered way to visulaise this ... Hope you understand something better from this.\n\nwe can consider following ex:\nnums : [ 1, 2, 3, 5, 7, 10, 12]. and k = 10<b>\n\n```\n\ni,j\n1     2     3     5     7     10    12\n+&-\noperation = 1 - 1 = 0\n------------------------------------------\n\ni     j\n1     2     3     5     7     10    12\n-     +\noperation = -1 + 2 = 1\n------------------------------------------\n\ni           j\n1     2     3     5     7     10    12\n-    +&-    +\noperation = -1 +2 -2 +3 = 2\n------------------------------------------\n\ni                 j\n1     2     3     5     7     10    12\n-     -     +     +\noperation = -1 -2 +3 +5 = 5\n------------------------------------------\n\ni                       j\n1     2     3     5     7     10    12\n-     -    +&-    +     +\noperation = -1 -2 +3 -3 +5 +7 = 9\n------------------------------------------\n\ni                             j\n1     2     3     5     7     10    12\n-     -     -     +     +      +\noperation = -1 -2 -3 +5 +7 +10 = 16\n------------------------------------------\n\nNow as the operation is more than k = 10, we will now move i to forward\nSo here we have to add 1 & subtract 5, to maintain the sign of left  half item negative and right half positive.\n\n      i                       j\n1     2     3     5     7     10    12\n-&+   -     -    +&-    +      +\noperation = (-1 -2 -3 +5 +7 +10) +1 -5 = 12\n------------------------------------------\n\nOn next move again we add 2 & remove 5 one more. In previous step its in middle so its just cancel + & -, but here we have subtracted one more time and you can see the first two are - and second 2 are + in the range [i, j]\n            i                  j\n1     2     3     5     7     10    12\n-&+  -&+    -     -     +      +\noperation = (-1 -2 -3 +5 +7 +10) +1 -5 +2 -5 = 9\n------------------------------------------\n\nNow as the operation count is 9 which is less than k we can cont incrementing j again.\n\n\n```\n\n# Complexity\n- Time complexity: O(N.logN)\n- Space complexity: O(1)\n\n# Code\n```\nint maxFrequencyScore(vector<int>& nums, long long k) {\n    sort(nums.begin(), nums.end());\n    long long operation = 0, ans = 0;\n    for(long long i = 0, j = 0; j < nums.size(); ++j){\n        operation += nums[j] - nums[(i+j)/2];\n        while(operation > k){\n            operation += nums[i] - nums[(i + j + 1)/2];\n            i++;\n        }\n        ans = max(ans, j - i + 1);\n    }\n    return ans;\n}\n```\n\n\n\n---\n\n\n<b>Here is an article of my interview experience at Amazon, taht may be helpful for you : \nhttps://leetcode.com/discuss/interview-experience/3171859/Journey-to-a-FAANG-Company-Amazon-or-SDE2-(L5)-or-Bangalore-or-Oct-2022-Accepted\n\n---
['C++']