Python3 solution || Beginner friendly
\nclass Solution(object):\n    def minimumDeletions(self, word, k):\n        a=list(Counter(word).values())\n        a.sort(reverse=True)\n        ans=float("in
```\nclass Solution(object):\n    def minimumDeletions(self, word, k):\n        a=list(Counter(word).values())\n        a.sort(reverse=True)\n        ans=float("inf")\n        for i in range(len(a)):\n            temp=0\n            for j in a:\n                """\n                    j can be in 3 cases. \n                      1.either a[i]-k<=j<=a[i]+k which we actually need\n                      2.j<a[i] --> in this we directly remove j elements of that respective character\n                      3.j>a[i]+k --> here we remove only j-(a[i]+k) character which is minimum characters to remove to make string k-Special\n                    \n            we are checking min_del for each string in word to make other character be in range count(string)-k<count(ele)<count(string)+k\n                """\n                if j>a[i]+k: #we should remove extra characters of j to make it equal to a[i]+k\n                    temp+=j-(a[i]+k)\n                elif j<a[i]:\n                    temp+=j\n            ans=min(temp,ans)\n            if ans==0:\n                break\n        if ans!=float("inf"):\n            return ans\n        return 0\n                \n```
['Array', 'Hash Table', 'Math', 'Sorting', 'Python3']