O(N) Easiest java solution.
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```\nclass Solution {\n    public int minimumDeletions(String word, int k) {\n        int answer = Integer.MAX_VALUE;\n        int[] f = new int[26];\n        for(int i = 0; i < word.length(); i++) {\n            f[word.charAt(i) - \'a\'] += 1; \n        }\n        for(int i = 0; i < f.length; i++) {\n            if(f[i] == 0) continue;\n            int remove = 0;\n            for(int j = 0; j < f.length; j++) {\n                if(f[j] == 0) continue;\n                if(f[i] > f[j]) remove += f[j];\n                else if(Math.abs(f[i] - f[j]) > k) {\n                    remove += f[j] - f[i] - k;\n                    // remove += Math.min(Math.abs(f[i] - f[j]) - k, f[j]);\n                }\n            }\n            answer = Math.min(answer, remove);\n        }\n        return answer;\n    }\n}\n```
['Java']