Check all ranges
\nclass Solution:\n    def minimumDeletions(self, word: str, k: int) -> int:\n        n = len(word)\n        ctr = Counter(word)\n        res = float(\'inf\')\n
```\nclass Solution:\n    def minimumDeletions(self, word: str, k: int) -> int:\n        n = len(word)\n        ctr = Counter(word)\n        res = float(\'inf\')\n        for minf in range(1, n + 1):\n            maxf = minf + k\n            curr = 0\n            for c in ctr:\n                if ctr[c] < minf:\n                    curr += ctr[c]\n                if ctr[c] > maxf:\n                    curr += ctr[c] - maxf\n            res = min(res, curr)\n        return res\n```
['Python']