Python Easy Solution
Code\nJava\n\nclass Solution {\n    public int minimumDeletions(String word, int k) {\n        int[] freq = new int[26];\n        for(char ch:word.toCharArray()
# Code\n**Java**\n```\nclass Solution {\n    public int minimumDeletions(String word, int k) {\n        int[] freq = new int[26];\n        for(char ch:word.toCharArray()){\n            freq[ch-\'a\']++;\n        }\n        \n//         Sorted in Increasing order\n        Arrays.sort(freq);\n        int min_del = Integer.MAX_VALUE;\n        \n        for(int i=freq.length-1; i>=0; i--){\n            int trgt = freq[i];\n            int dels = 0;\n            \n            for(int f:freq){\n                if(f > trgt + k){\n                    dels += f - (trgt+k); \n                } else if(f < trgt){\n                    dels += f;\n                }\n            }\n            \n            min_del = Math.min(min_del, dels);\n            if(min_del == 0){\n                break;\n            }\n        }\n        \n        return min_del==Integer.MAX_VALUE?0:min_del;\n    }\n}\n```\n**Python**\n```\nclass Solution:\n    def minimumDeletions(self, word: str, k: int) -> int:\n        freq = {}\n        for char in word:\n            freq[char] = freq.get(char, 0)+1\n            \n        \n        frequencies = sorted(freq.values(), reverse=True)\n        min_del = float(\'inf\')\n        \n        for i in range(len(frequencies)):\n            trgt = frequencies[i]\n            dels = 0\n            for f in frequencies:\n                if f>trgt+k:\n                    dels += f - (trgt+k)\n                elif f < trgt:\n                    dels += f\n            min_del = min(min_del, dels)\n            if min_del == 0:\n                break\n        \n        return min_del if min_del != float(\'inf\') else 0\n```
['Array', 'Python', 'Python3']