Simple Java Solution
Code
# Code\n```java []\nclass Solution {\n    int result=Integer.MAX_VALUE;\n    public void Solve(int arr[],int i, int j, int score,int k)\n    {\n        \n        if(i>=j)\n        {\n            result=Math.min(result,score);\n            return;\n        }\n        if(arr[j]-arr[i]<=k)\n        {\n            \n             result=Math.min(result,score);\n            return;\n        }\n\n        Solve(arr,i+1,j,score+arr[i],k);\n        Solve(arr,i,j-1,score+arr[j]-arr[i]-k,k);\n\n    }\n    public int minimumDeletions(String word, int k) {\n        int ch[]=new int[26];\n      for(int i=0;i<word.length();i++)\n      {\n         ch[word.charAt(i)-\'a\']++;\n      }\n      int count=0;\n      for(int i=0;i<26;i++)\n      {\n        if(ch[i]!=0)\n        {\n            count++;\n        }\n      }\n      if(count==1)\n      {\n        return 0;\n      }\n      Arrays.sort(ch);\n      int arr[]=new int[count];\n      int t=0;\n      while(ch[t]==0)\n      {\n        t++;\n      }\n      int j=0;\n      for(int i=t;i<26;i++)\n      {\n        arr[j]=ch[i];\n        j++;\n      }\n\n      Solve(arr,0,count-1,0,k);\n\n      return result;\n \n    }\n}\n```
['Java']