Sort char frequency and check window with k
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\npublic class Solution {\n    public int MinimumDeletions(string word, int k) {\n        int minDel = int.MaxValue;\n        Dictionary<int, int> dict = new Dictionary<int, int>();\n\n        foreach(char c in word)\n        {\n           if(!dict.ContainsKey(c))\n                dict.Add(c, 1);\n            else dict[c]++;\n        }\n\n        List<int> valuesList = dict.Values.ToList();\n        valuesList.Sort();\n\n        int sumLeft = 0, len = valuesList.Count(); \n\n        for(int i = 0; i < len; i++)\n        {\n            sumLeft += (i == 0? 0 : valuesList[i-1]);\n\n            int outOfRange = sumLeft;\n            for(int j = i+1;j < len; j++)\n            {\n                if(valuesList[j] -valuesList[i] > k)\n                    outOfRange += (valuesList[j] - valuesList[i]-k);\n            }\n\n            minDel = Math.Min(minDel, outOfRange);\n        }\n\n         return minDel;\n    }\n}\n```
['C#']