Easy Java Solution
\n# Code\n\n\nclass Solution {\n    public int minimumDeletions(String word, int k) {\n        \n        // store the frequency of the character\n        Intege
\n# Code\n```\n\nclass Solution {\n    public int minimumDeletions(String word, int k) {\n        \n        // store the frequency of the character\n        Integer []arr=new Integer[26];\n         for(int i=0;i<arr.length;i++) {\n            arr[i]=0;\n        }\n        for(int i=0;i<word.length();i++)\n        {\n            arr[word.charAt(i)-\'a\']++;\n        }\n       \n        // sort the array in reverse order\n        Arrays.sort(arr,Collections.reverseOrder());\n       // System.out.println(Arrays.toString(arr));\n        int ans=Integer.MAX_VALUE;\n        for(int i=0; i<arr.length && arr[i]!=0;i++)\n        {\n            int freq=arr[i];\n            int del=0;\n            //checking the how many character need to be deleted\n            for(int j=0;j<arr.length && arr[j]!=0;j++)\n            {\n                if(arr[j]>freq+k){\n                    del+=arr[j]-(freq+k);\n                }\n                else if(arr[j]<freq) {\n                    del+=arr[j];\n                }\n            }\n            // store the minimum deletion\n            ans=Math.min(ans,del);\n           \n        }\n\n        //if ans is Integer max value means no need of deletion then directly return 0\n        return ans;\n    }\n}\n```
['Java']