Simple python3 solution | 85 ms - faster than 100.00% solutions
Complexity\n- Time complexity: O(n + m) = O(n)\n Add your time complexity here, e.g. O(n) \n\n- Space complexity: O(m) = O(1)\n Add your space complexity here, 
# Complexity\n- Time complexity: $$O(n + m) = O(n)$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: $$O(m) = O(1)$$\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\nwhere `m = 26` - number of lowercase English letters\n\n# Code\n``` python3 []\nclass Solution:\n    def minimumDeletions(self, word: str, k: int) -> int:\n        count = sorted(Counter(word).values())\n        \n        prefix = 0\n        suffix = sum(count)\n        \n        m = len(count)\n        j = 0\n\n        result = suffix\n        for i, a in enumerate(count):\n            while j < m and count[j] - a <= k:\n                suffix -= count[j]\n                j += 1\n            current = prefix + suffix - (m - j) * (a + k)\n            result = min(result, current)\n            prefix += a\n        return result\n```
['Two Pointers', 'Sliding Window', 'Sorting', 'Counting', 'Python3']