[Java] Simple solution frequency array
Upvote if you learn something new :)\n\nclass Solution {\n    public int minimumDeletions(String word, int k) {\n        int[] freq = new int[26];\n        \n  
**Upvote if you learn something new :)**\n```\nclass Solution {\n    public int minimumDeletions(String word, int k) {\n        int[] freq = new int[26];\n        \n        for(char c : word.toCharArray()){\n            freq[c-\'a\']++;\n        }\n        \n        int min = Integer.MAX_VALUE;\n        for(int i=0; i<26; i++){\n            int del = 0;\n            for(int j=0; j<26; j++){\n                if(freq[j] < freq[i])\n                    del += freq[j];\n                else if(freq[j] > freq[i] + k)\n                    del += (freq[j]-freq[i]-k);\n            }\n            \n            min = Math.min(min, del);\n        }\n        \n        \n        return min;\n    }\n}\n```
['Java']