Interesting efficient O(n) O(1) solution
IntuitionApproachComplexity
Time complexity: O(n)

Space complexity: O(1)
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity: O(n)
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity: O(1)
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```javascript []
/**
 * @param {string} word
 * @param {number} k
 * @return {number}
 */
var minimumDeletions = function(word, k) {
    let freq = new Array(26).fill(0);
    for(let i = 0; i < word.length; i++) freq[word.charCodeAt(i) - 97]++;
    freq.sort((a, b) => a - b);
    let start = 0;
    for(let i = 0; i < 26; i++) if(freq[i] != 0) { start = i; break; }
    let min = Infinity;
    let prevEliminated = 0;
    for(let i = start; i < freq.length; i++){
        let curEqualize = 0;
        for(let j = i+1; j < freq.length; j++) if(freq[i] + k < freq[j]) curEqualize += freq[j] - k - freq[i];
        min = Math.min(min, curEqualize + prevEliminated);
        prevEliminated += freq[i];
    }
    return min;
};
```
['Hash Table', 'Sorting', 'Counting', 'JavaScript']